SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Disabling text fields at run time.

    Good day everyone,

    I have absolutely no experience with complicated JavaScript...only with basic stuff which doesn't really count.

    I have a form in HTML with several text fields.

    In this form I will also have two radio buttons which will serve as a choice. The user has two choices. If the one radio button is active/checked, then some text fields will be completely disabled. If the other radio button is checked/active, then these exact same text fields will be enabled.

    To give you a better idea of what I need to do.
    It's a purchase form. It's for selling software. The user can either choose to download the software directly from the server, or the user can have it delivered to his house/business.

    The two radio buttons will represent "download" OR "shipping". If the user selects shipping radio button, then a few text fields for shipping information will be enabled.

    Is this complicated? Can it easily be done?
    I will really appreciate it if someone could help me do this.

    Thank you so much.

    Best Regards,
    Contrid.
    And so I got lost in code...completely asphyxiated by it...

    Premium WordPress plugins - Tribulant Software

  2. #2
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    First you need to access the HTML elements with document.getElementById, or document.forms. Once you have accessed the desired element, change its disabled property to true.

    That should give you a good start to improve your JavaScript skills

  3. #3
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria
    First you need to access the HTML elements with document.getElementById, or document.forms. Once you have accessed the desired element, change its disabled property to true.

    That should give you a good start to improve your JavaScript skills
    Thanks man.
    I want to buy the JS Anthology book this week to learn some JS.
    I've seen some really amazing things, and I would love to be able to use them in my webpages.
    Would you recommend this book? The one by SitePoint.
    And so I got lost in code...completely asphyxiated by it...

    Premium WordPress plugins - Tribulant Software

  4. #4
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My favorite JavaScript book is "JavaScript Bible, 5th Edition" by Danny Goodman. Its simply great, and I still use it as a reference (although the book itself is not a reference book, its great for beginners as well).

    Have not read the JS Anthology book, so I couldn't tell

  5. #5
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Pepejeria
    My favorite JavaScript book is "JavaScript Bible, 5th Edition" by Danny Goodman. Its simply great, and I still use it as a reference (although the book itself is not a reference book, its great for beginners as well).

    Have not read the JS Anthology book, so I couldn't tell
    I don't really like paper/hardback books.
    I would prefer to buy a PDF or something similar. Something digital which I can have open on my other screen. Makes life alot easier. Any suggestions for PDF's?
    I guess I could find many of them by searching for them, but I'm not really sure which ones are worth buying and reading.
    And so I got lost in code...completely asphyxiated by it...

    Premium WordPress plugins - Tribulant Software

  6. #6
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The JavaScript Bible comes with a CD that has the entire book in a PDF



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •