Results 1 to 2 of 2

Thread: Forms

  1. #1
    Join Date
    Jun 2009
    Posts
    12

    Forms

    Hi all,

    Can any of you'll guide me to some tutorials that explains how one can create a dropdown list and based on the choice, add additional input fields?

    Thanks very much in anticipation.

    Norbert

  2. #2
    Join Date
    Feb 2009
    Location
    Monroe, NY
    Posts
    33
    Hi norbert,
    Your basic javascript tutorial will teach you how to do the following.

    Use the onchange attribute in the <select> opening tag to call a javascript method that adds the input fields. This allows you to add fields without refreshing the page, which is both quick and snazzy client-side. Your javascript method can either 1) set the hidden field's css display value from the preset 'hidden' to 'block' or other such display value or 2) just add more input fields to the page, which will require a little bit more coding. You could put the area you want the new input field to be displayed in into an empty div and use the javascript .innerHTML property to define the empty div's content.

    You can use PHP or some other server side programming to do this, but overall, it is probably easier to use javascript, though in the future you might want to make the form work for those with javascript turned off if you are expecting a lot of people to use the form. I'm sorry but I don't know of any tutorials specific to your question, but you can learn about onchange at http://www.w3schools.com/jsref/jsref_onchange.asp.

Similar Threads

  1. forms website
    By aaronv in forum Client & Server Side Scripting (PHP, ASP, JavaScript)
    Replies: 1
    Last Post: 23 Jun 2009, 11:28 AM

Posting Permissions

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