FORM Help needed Please

Discussion in 'Software' started by Jodi, Jan 6, 2005.

  1. Jodi

    Jodi Private First Class

    Hi Everyone, I am attempting to modify a form so that I can include a way that the user can check box and then have certain other fields be active (able to fill in) and check another box and have those same fields be grayed out (not able to fill in) Is this possible? I have an example if necessary. Please scroll down on the form to the red and yellow highlights, there is a description there. http://www.yourpagetoday.com/reg_form1.htm

    Thanks a bunch everyone.
    ~Jo.
     
  2. shedlord

    shedlord Private E-2

  3. Jodi

    Jodi Private First Class

    Hi, I just took a quick look at the first link you posted, that looks exactly like what I am thinking of. I will check it out, and experiment with it.
    Thank you very much!!!!!
    ~Jo
     
  4. Jodi

    Jodi Private First Class

    OK I have been playing with the script and I have determined that this is exactly what I am looking for but.....I have a small dilemma...please look
    http://www.yourpagetoday.com/testingForm.htm

    Thank you once again!
    ~JO
     
  5. shedlord

    shedlord Private E-2

    Ok, I should have checked this before posting. The Sitepoint one you are trying doesn't seem to like Firefox either. The http://dougal.gunters.org/test/dynform/ method works in IE and Firefox.

    Here's an amended version that does what you want:
    http://www.itorg.co.uk/test.html

    Basically the same but with the Toggle function doubled up...

    // Toggle the state of a form element.
    function toggle(what,how,what2,how2) {
    if (what.disabled) {
    enable(what,how);
    } else {
    disable(what,how);
    }
    if (what2.disabled) {
    enable(what2,how2);
    } else {
    disable(what2,how2);
    }
    }

    ...and the input onclick changed accordingly...

    <input type="checkbox" name="CheckOne" value="ON" onclick="toggle(Input1,true,Input2,true)" checked>
     
  6. shedlord

    shedlord Private E-2

    ps. Also just noticed the Reset button on the original needs fixing (unticking the box then clicking reset doesn't reset the state of the fields)

    Here's a fixed one...

    http://www.itorg.co.uk/test2.html

    ...just needed calls to the enable function from the reset button:
    <input type="reset" value="Reset" name="Reset" onclick="enable(Input1);enable(Input2)">

    None of this is gonna win any tidy code awards, but it does the job!
     
  7. Jodi

    Jodi Private First Class

    Thank you so much! You have no idea how much time you have saved me, not to mention stress. I truly appreciate this. I am good in the design end of things but just a rookie scripter, although I do understand it well. Ok, I am off for another round of testing. THANK YOU AGAIN!!!
    ~Jo.
     
  8. Jodi

    Jodi Private First Class

  9. Jodi

    Jodi Private First Class

    Wow, just got it, I re-copied your code, tried it again, and it worked with 3 fields, ok here goes 4 and 5.
    By Golly I think I got it!

    ~Jo.
     

MajorGeeks.Com Menu

Downloads All In One Tweaks \ Android \ Anti-Malware \ Anti-Virus \ Appearance \ Backup \ Browsers \ CD\DVD\Blu-Ray \ Covert Ops \ Drive Utilities \ Drivers \ Graphics \ Internet Tools \ Multimedia \ Networking \ Office Tools \ PC Games \ System Tools \ Mac/Apple/Ipad Downloads

Other News: Top Downloads \ News (Tech) \ Off Base (Other Websites News) \ Way Off Base (Offbeat Stories and Pics)

Social: Facebook \ YouTube \ Twitter \ Tumblr \ Pintrest \ RSS Feeds