Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Question how do i have a textbox appear when a checkbox is checked?

    hi im new here, i found this forum in a yahoo search. i am only here because i have this magnificent vision on the perfect form for me, but i have no idea how to make it.

    what i want is a form with only checkboxes, text boxes, and pulldown menus. but it gets a bit harder than that. when a checkbox is checked, i want the text box to be accessible. or when the checkbox is unchecked, then the text box is hidden again.

    i see this kind of thing in "Terms of Agreement" pages. like you have to check a box that says you agree to the terms, then you can click the "Continue" button to proceed with the thing you were doing.

    instead of a "Continue" button, i want it to be a checkbox. is this possible?

    if you need more information, just ask me. or since i wont be checking this forum too often, you can email me at kenny14390@yahoo.com

    if you could, please provide the JS code. i am fairly new to javascript, but i have used it before. i have made many forms before also, but this is pushing my knowledge.

    THANKS!!
    Last edited by Ricky158; 08-19-2002 at 01:11 AM.

  • #2
    New Coder
    Join Date
    Jun 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    That shouldn't be too difficult, but how about you create the form so we can actually see exactly what we are dealing with (preferably put it online).

  • #3
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts
    well.. this would be a fairly large form. and it will take a while. i am willing to make it for u guys, but i need this info before i can make it, for it to work right.

    here's a more descriptive description of what i want.

    it will start off with the word "Caps" as the title of the section. then under that will be a checkbox to the left of the number "4100". then next to that, it will say "$... each". and if the person decides to check the checkbox, and they do, then a *pull-down menu* (sorry guys, i changed my mind, pull-downs are easier... a radio button thing would work also) will appear giving the user the option to select 1, 2, or 3 of the item. i can't have a simple "type as many as you want" thing, because i have a limited supply. this will basically be the entire form.

    i know how to make the form, and submission buttons, etc. it's just the part where the checkbox is checked, then a new feature could be used, that confuses me. if it is absolutely necessary, i will make a form (not the entire thing) but the meat and potatoes of the thing. just let me know what i need to do. thanks.

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts
    ahhhh... this thread is being swept away to pages beyond 1. i have made a little form with only one line of the many that i want. you can see the form here: http://angelfire.com/extreme3/waterguns/T3ST.html

    if you try to submit querie, it'll say you missed a field. i dont know why, but it doesnt matter, because this is not the official form.

    PLEASE! try to help me! and how do i create a dropdown menu in the format "<input type="(dropdown menu name here)"> name="dropdown_menu_result">" so basically, what goes after <input type=".... ?? also, for the checkbox thing, is there a code that i can say something like

    <input type="checkbox" name="checkbox_result12" onCheck=<input type="drop down menu" name="dropdownmenu_result12">>

    is that possible? or even close to anything possible? PLEASE HELP!!

  • #5
    New Coder
    Join Date
    Jun 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here is what I came up with.

    Code:
    <?xml version="1.0"?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
      <head>
        <title>T3STING!</title>
      </head>
      <body>
        <h1 align="left">T3STING!</h1>
        <form action="/cgi-bin/choose_search" method="post">
          <p>Caps<br />
            <input type="checkbox" name="Cap_4100" onclick="document.forms[0].elements['engine'].disabled=!this.checked" /> 4100 Price: $2.00 each 
            <input type="hidden" name="matchmode" value="and" />
            <select name="engine" size="1" disabled="disabled">
              <option value="mixed" selected="selected">Quantity</option>
              <option value="lycos">1</option>
              <option value="hotbot">2</option>
              <option value="mp3">3</option>
            </select>
          </p>
          <input type="hidden" name="end_display" value="http://angelfire.com/extreme3/waterguns" />
          <input type="hidden" name="required" value="email" />
          <input type="hidden" name="order" value="Cap_4100, matchmode" />
          <input type="hidden" name="savefile" value="visitors.txt" />
          <input type="hidden" name="email_to" value="kenny14390@yahoo.com" />
          <input type="submit" value="Send Feedback" />
          <input type="reset" value="Clear Form" />
        </form>
      </body>
    </html>
    I hope that the section on bold is relatively cross-browser. Someone else care to comment on it?

  • #6
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts
    thanks. that code worked. and it did exactly what it should. i'm catching on with this code, and understanding how it works. and now i am adding a second option. here is how far i am as of now: http://www.angelfire.com/extreme3/waterguns/T3ST.html

    my only problem now, is that when i try to submit the info, it says that not all of the fields have been filled in. see for yourself. feel free to View Source and investigate this problem.

  • #7
    New Coder
    Join Date
    Jun 2002
    Posts
    24
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't see anything in the source, so it looks like anglefire is doing some sort of server-side thing. They may have thought that it was a clever idea to validate all forms on the site, but it is going to cause you problems. I would talk to them about it if that is the site you will be using for the finished form.

  • #8
    Regular Coder
    Join Date
    Aug 2002
    Location
    New York
    Posts
    152
    Thanks
    12
    Thanked 0 Times in 0 Posts

    Unhappy

    i tried emailing them once before. and since they had no catagory for me to accurately describe my problem, i had to just put "ftp help" so then they emailed me back with an automated message telling me to go see the FTP page... AHH!!!

    i can try again, but i dont know if it'll work. thanks though.

    and i think radio buttons would work more smoothly than a pulldown, but i can still use the cool feature you taught me. thanks


  •  

    Posting Permissions

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