Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: Form Updater

  1. #1
    New to the CF scene
    Join Date
    Oct 2011
    Thanked 0 Times in 0 Posts

    Form Updater

    Hey guys, I am currently doing an assignment with a couple of group members but I have ran into a bit of a problem.

    I have a dropdown box and 3 Input Fields. The dropdown box contains a bunch of Names from the database, and what I want it do is make the input fields update depending on what value I select from the dropdown box.

    I was wondering what would be the best way to do this... since I am not sure how to create a dynamic elements. Could someone point me in the right direction?

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Thanked 4,747 Times in 4,709 Posts
    Why would you want to create elements dynamically???

    Just copy the selected value(s) from the <select> into <input> fields that already exist in the same <form>. Nothing could be simpler.

    Are you going to use a <select multiple> (where the user can choose more than one <option>) or do you intend to have a simple <select> and, each time it is change, take the newly selected value and put it into an <input>?

    Or do you mean that when you select one <option> all three fields are filled in with data *related* to the given <option>? If so, where does that additional related data come from? [HINT: You actually *can* hide it all in the value= of the <option>s.]

    Or or or or...
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.


    Posting Permissions

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