HTML - Html Forms, Dynamic Number Of Check Boxes
Hello, I'm fairly new to HTML and scripting and could use some help.
I'm setting up an HTML form with a CGI script (script1) and submitting data to another CGI script (script2) with the POST method using enctype="application/x-www-form-urlencoded". I create my form page with script1 based upon files and it will create a number of check boxes. My problem is that I do not know exactly how many check boxes are created. If they are checked they submit a value, however, if they are not checked, they are not listed in the Query String. So script2 does not know if there is an unchecked check box after the last checked one. Is there an option or a different enctype that will submit their value with a NULL string if they are not checked? Or is there any other way to get around this issue? Any Help you can give me is greatly appreciated. Thanks in advance Similar TutorialsHey everyone, I just want to know if anybody knows any code that will set the amount of checkboxes that are allowed to be checked in a form. Say there are 30 check boxes, but I only want the user to be able to check 10, how could I do this? Preferably so that if there are too many boxes checked when they click, 'SUBMIT', then an error message will pop up telling them that they have checked too many boxes. Thanks in advance. I was wondering if there was any way to do this: I have a site that has a catalog. There are 10 - 20 items per page and about 15 pages/categories. Each item will have a check box. When a checkbox is clicked a window will open (containing a list of EVERY item, quantities, etc.) and a check box next to that particular item will be automatically checked. Then as the user clicks through the catalog and checks off boxes they will be filled in in the new window as well. Basically I need to know how to check a box in one window and have it check a box in another window at the same time. Thanks. hi guys! great day. i'm having problems getting the code for the submit button linked to my checkboxes. our professor wanted that every option or choice that we check on the check box, by clicking the submit button, the pop window should display "you have chosen (your choice/s that you have checked)" this is the code that my professor gave us. (just copy paste the code and open it) <!Doctype html public *-'W3C// DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content ="text/html; charset = ISO-8859" http-equiv="content-type"> <meta keywords = "begin javascript"> <script type="text/javascript"> function outputVariableValues() { var yourName= document.myform.name.value; window.alert ("Hello: "+ yourName); window.alert ("Your Comment: "+ document.myform.comments.value); window.alert ("Thanks for rating us: " + document.myform.rating.value); } </script> <script type="text/javascript"> document.write("www.Ricmer.Mylene"); window.alert ("Welcome to heaven on earth") </script> <title>Web Form01</title> </head> <body> <center><h1>Nikki Nikko Webpage</h1></center> <form name="myform" method="" action=""> <p><label>Name:<input type ="text" value = "jasmine" name="name" size="25"></label> <p><label>Comments:<br><textarea name = "comments" rows = "4" cols ="36">Enter your comments here. </textarea></label></p> <p><label>Rate our Website</label> <select name = "rating"> <option selected ="selected">Amazing</option> <option>10</option> <option>9</option> <option>8</option> <option>7</option> <option>6</option> <option>5</option> <option>4</option>\ <option>3</option> <option>2</option> <option>1</option> <option>Awful</option> <input type = "button" name="submit" Value="Submit" onclick="outputVariableValues()"> <input type ="reset" value ="Reset" name="Reset"> </form> </body> </html> we're going to pass this activity tonight at 9pm. it's 4:12pm now..-_- this is our first time in html coding so i'm very sorry guys..and thanks in advance! Hello, I have designed sites in the past but am in need of some assistance. I am designing a website for an artist who wants to be able to offer his clients fine art prints for sale. He needs to be able prints with several different product options; i.e. canvas print with 1" stretch, 2" stretch and framed prints. I want to be able to offer check boxes (or equivalent) that will display an image of the different product options available. If the 1" stretch check box is checked I need an image of a canvas on a 1" gallery wrap frame to be displayed. If they click on the "frame" check box, I need an image of a framed painting to be displayed. What is the best method to use to accomplish this? I've researched and experimented but am at a bit of a loss. Any help will be greatly appreciated. Thank you in advance!! -John Apologies in advanced if this has been solved in another forum. I found my answer googling around but i need it refined. One checkbox with two disabled radio buttons. When user clicks on check box it enables both radio buttons and a input text field. Code: <script type="text/javascript"> function enable(x){ if(x.checked){document.formTest.rRegular.disabled=0} else{document.formTest.rRegular.disabled=1}} </script> </head> <body> <form name="formTest" method="POST" action="--WEBBOT-SELF--"> <p><input type="checkbox" name="cbFlower" value="ON" onClick="enable(this)">Flowers</p> <p><input type="radio" checked name="rRegular" value="V1" disabled=1>Regular Package <input type="radio" name="rDeluxe" value="V2" disabled=1>Deluxe Package</p> <p><input type="text" name="tFlower" size="40" disabled=1></p> </form> I'm sure its a simple modification to the 'funciton enable' so that it enables the other radio button and text box. I need to repeat this process for other groups of similiar check boxes with 2 or more radio buttons and a text field. They need to be independent of each other. If this one get's solved I can copy the function and modify it for the other groups. Unless there's a simpler way. Thanks for your help Hi All, I have come across a scenario where user enters credit card number. So I need to display user typing text (card number) as "*" in the text box. So I went and coded as password field since password box always mask user inputs. <input type="password" name="f1" value=""> But on hitting submit button, Mozilla firefox browser shows a pop up if I need to remember the password or not. My client dont want to display this pop-up. Can anyone pls tell me how to create a text box (not password box) to show user input as "*" so that it looks like as password box. Thanks in advance. Hello, I was just wondering if anybody can help me I'm having a few problems designing my website and I've gone through all the code but can't work out what I doing wrong. I basically want to put an image (box.gif) behind the text in my website. I've attached the image (box.gif) and the index.php as a text file. Can anyone see where I am going wrong and why the image is not appearing behind the text - i've been going through the html for a few days now and still can't seem to fix the problem. An example of the boxes would be the grey boxes below the large image at www[DOT]englandathome[DOT]co[DOT]uk Any help would be much appreciated. Thanks in Advance! Hi Folks, I've got my form dynamically generating text fields (which are contained in a form which is in another) and other objects and now I want to give them the "onchange" attribute. I have a lot of code so I'll keep it as small as possible. Here is the function that generates text fields function createText( inputForm, txtName, txtValue, txtWidth ) { var newTxt = document.createElement( "INPUT" ); inputForm.appendChild( newTxt ); newTxt.name = txtName; newTxt.setAttribute( "STYLE", "position:relative; left:20px; width:" + txtWidth + "px;"); newTxt.type = "TEXT"; newTxt.value = txtValue; newTxt.id = txtName; newTxt.onchange = "some_function( this.value )"; return newTxt; } The function for responsible for creating the form is: function createNewForm() { // Main form is a global reference to the main body mainForm = document.getElementById( "adminForm" ); var profileForm = document.createElement( "FORM" ); mainForm.appendChild( profileForm ); profileForm.method = "POST"; profileForm.name = "Profile"; profileForm.id = "ProfileForm"; return profileForm; } This function calls the profile creation form and specifies the objects that will appear on the form. function profileForm() { // Delete and reassign current form if( currentForm != "") deleteForm( currentForm ); currentForm = "ProfileForm"; var newProForm = createNewMenuForm(); newProForm ( menuForm, "Item1", "data1", 140 ); newProForm ( menuForm, "Item2", "data2", 140 ); newProForm ( menuForm, "Item3", "data3i", 140); return newProForm; } I've seen examples of objects being created by JavaScript and they work just fine. Anyone have any suggestions or have an idea where I can find some more info? Thanks! Hi, I am looking for some help with HTML forms, namely forms which mainly comprise of drop-down boxes. I know how to create drop-down boxes in forms, though what I want is that each variable in the drop-down box should go to a different URL. For example, if someone selects "variable 1" and then clicks submit, it should go to a different URL than when they select "variable 2" and click submit. I have all the URL's, though I'm just not sure of how to make each variable go to a different URL. Can someone help me out with this? If anyone knows of a site which has something similar like this can you please direct me to it so that I can look at he source? Thanks. I kinda know how to add a scrolling box function to a post, but there's this problem I have with putting certain things inside of the box. So i somehow managed to get another post in scroll before when it was long .. but I CANNOT get this one to work! i mean. it only puts one part of the post inside of the scroll box. . Help greatly appreciated! Code: [align=center]TO BE ADDED TO CONTACTS.[/align] [doHTML]<center><img src='http://i39.tinypic.com/i5oscx.jpg'> <br><font color="#ddc48e" face="arial" size="2"><I>KYLER EMERY COLLINS. 8532 980 2236. THREE.</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="#ddc48e" face="arial" size="2"><I>YOU AND I , ANARBOR.</I></font> without you, there's no reason for my story and when i'm with you i can always act the same forever, yeah if we're together we can make it better you and i we never get to sleep we're up all day we're overworked and underpaid you and i we're always stuck in repeat day by day watching time drift away as we burn away without you, there's no reason for my story and when i'm with you i can always act the same forever, yeah if we're together we can make it better ------------------------------------------------------------ </div></div></center>[/dohtml] [CODE*][CODE*][doHTML]<center><img src='300x150 image here'> <br><font color="#group color" face="arial" size="2"><I>FIRST MIDDLE LAST. #### ### ####. SPEEDIAL NUMBER.</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="group color" face="arial" size="2"><I>RINGTONE , ARTIST.</I></font> a few lines of lyrics from ringtone. don't have to make it aligned. ------------------------------------------------------------ </div></div></center>[/dohtml] [/CODE*][/CODE*] [align=center]TO SEND A TEXT[/align] [doHTML]<center><img src='http://i39.tinypic.com/i5oscx.jpg'> <br><font color="#ddc48e" face="arial" size="2"><I>KYLER EMERY COLLINS. SENT ON MARCH 12TH.</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="#ddc48e" face="arial" size="2"><I>NINE OH FIVE PM.</I></font> dayum. why aren't you picking up your phone? at least text me back? ------------------------------------------------------------ </div></div></center>[/dohtml] [CODE*][doHTML]<center><img src='300x150 image'> <br><font color="#group color" face="arial" size="2"><I>FIRST MIDDLE LAST. SENT ON MONTH #</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="#group color" face="arial" size="2"><I>TIME SPELT OUT AM/PM.</I></font> message. don't block your text. ------------------------------------------------------------ </div></div></center>[/dohtml] [/CODE*] [align=center]TO CALL.[/align] [doHTML]<center><img src='http://i39.tinypic.com/i5oscx.jpg'> <br><font color="#ddc48e" face="arial" size="2"><I>INCOMING CALL FROM KYLER EMERY COLLINS...</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="#ddc48e" face="arial" size="2"><I>NINE FORTY FIVE PM.</I></font> without you, there's no reason for my story and when i'm with you i can always act the same forever, yeah if we're together we can make it better you and i we never get to sleep we're up all day we're overworked and underpaid you and i we're always stuck in repeat day by day watching time drift away as we burn away without you, there's no reason for my story and when i'm with you i can always act the same forever, yeah if we're together we can make it better ------------------------------------------------------------ </div></div></center>[/dohtml] [CODE*][doHTML]<center><img src='300x150 image'> <br><font color="group color" face="arial" size="2"><I>INCOMING CALL/ONGOING/CALL ENDED FROM/WITH FIRST MIDDLE LAST...</I></font> <p><div style="width: 300px; text-align:justify;"> ------------------------------------------------------------ <br><font color="group color" face="arial" size="2"><I>TIME SPELT OUT AM/PM.</I></font> if you're the first to post, use the lyrics from your ringtone. if not, just do what your character is saying. do not block text. ------------------------------------------------------------ </div></div></center>[/dohtml][/CODE*] [align=center][/align] I added this at the beginning of the post: Code: [dohtml]<center>><div style="width: 430px; height: 100px; overflow: auto"> because somehow, that worked for the other post i did. i did use closing tags. So when I added that code to the original post, all that happened, was that the first part of the post was able to get inside of the box and everything else was left out. I know somewhere in there, there's conflicting tags .. or something! lol not sure. Help gladly appreciated! I'm trying to type HTML code into a scroll box so people can copy it and paste it onto their own sites, rendering an image. Problem is, the code renders the image inside the scroll box, when I only want the code text. How do code it so that the image doesn't render, and only the code text is displayed? Hello, I have an html form on my site that looks fine under Safari and Firefox, but in Internet Explorer..., 3 small black outlined boxes appear and I don't know how to delete them... Here is a pictu Here is my Form code: Code: <form action="http://ww11.aitsafe.com/cf/add.cfm" method="post"> <input name="userid" type="hidden" value="D8242872" /> <input name="return" type="hidden" value="www.camelliafoods.com/onlinestore/store.html" /> <select size="1" name="productpr"> <option value="8-11 lb Bone-In Ham:29.99:1">8 - 11 lb Ham</option> <option value="11-13 lb Bone-In Ham:35.99:1">11-13 lb Ham</option> <option value="13-15 lb Bone-In Ham:41.99:1">13-15 lb Ham</option> <option value="15-17 lb Bone-In Ham:47.99:1">15-17 lb Ham</option> </select> <br> <input type="image" src="http://www.camelliafoods.com/images/cart1.png" alt="Add to Cart" value="submit"> </form> </form> Any ideas? Hello i am having some trouble aligning some checkboxes. I am trying to get them to sit side by side horizontally but when i do this with absolute positioning i will click the first set and it will check the second so i have to go way to the left of the first set to check mark it. Sorry for the butchered script. Thanks <div> <tr> <td height="40"> <label for="budget" class="label">Budget: From</label> <input name="budget" type="text" id="budget"> <span class="from">To</span> <label for="to" class="from"></label> <input name="to" type="text" id="to"> </td> </tr> </div> <tr> <td> <input name="boxesh" type="checkbox" id="home" value="walkdis"> <label for="home" class="checkboxes">Home</label><br> <input name="boxesb" type="checkbox" id="BoatDock" value="walkdis"> <label for="BoatDock" class="checkboxes">Boat dock</label><br> <input name="boxesv" type="checkbox" id="viewofwater" value="walkdis" title="Check the ones you want"> <label for="viewofwater" class="checkboxes">View of Water</label><br> </td> <td> I need a form where when you click "Submit" it does not open Outlook. Instead, I want it to email the information to be, but redirect them to a confirmation that the information has been sent. How do I do this? Thank you! Currently, I use MS FrontPage to build forms. I'd like to begin to move away from using FP extensions and just use FP for editing. I use several forms and I'd like to hear from anyone that can lead me to any freeware or shareware that I can use to build HTML forms instead of using FP's system. Whatever software I use for forms I'd like it to also include these 3 functions: 1. Allow for form error page 2. Allow for form acknowledgement page 3. Provide built in capability to send completed form data (via Submit) to specified email addresses. I've Googled this a few times but haven't been able to come up with what I'm looking for. I was hoping someone on this forum could help. Thanks I am totally new to web development. I have a project in which i have to make a form. It is not a simple form with only 2-3 input areas but a series of 3-4 pages to be filled by person to enter into database. I need a good software to design a form. pls suggest me one?? i tried front page but it is bull****. also i want to know that in my form I wantr that if user clicks a radio button then a part of form glows up and then user can fill out that options.(I mean to say that by clicking a particular radio button event ) thanks in advance Almon I am trying to make an HTML form with each field having an up and a down button next to it. There will be a total of 32 fields in a 4 by 8 table. The fields will be numerical starting with a value of 0. Then you can add or subtract 1 by pushing the corresponding button. I have figured out how to make the individule field using this code: <form> <input type=text name=amount value=5> <input type=button value="up" onClick="javascript:this.form.amount.value++;"> <input type=button value="down" onClick="javascript:this.form.amount.value--;"> </form> I can do this 32 times inside each cell of the table. But obviously I cannot submit this type of form do to the fact that you would end up with a <form> tag inside of a <form> tag. Is there any way around this? So that I can have the fields with their up and down buttons and then in the end be able to press the submit button and have it send the results in a text document to an email address using a php formmail script. I have a series of questions related to forms via html. 1. I am creating an employment application form. The form is pretty long, and I would like to create a "next" button that would bring the applicant to the next section, however I don't want it to submit because I would like to keep the application together in one piece (I might not be able to tell what piece belongs to which applicant, etc.). 2. The dreaded "SUBMIT" button... I've tried all the tutorials on the web that I can find, but I'm not sure I know exactly what's going on. Excuse me, but I am a little bit slow. A thorough explanation of how to create a mailto: myemail@mywebsite.com would be awesome. I don't know how to make it work. I put the "mailto" script in my forms, but nothing happens when I click submit. I will be posting the custom HTML to my form once it is complete so you can copy/paste however you'd like. To contact me directly, just go to: www.happypetpaws.net and click on my "Live Support" button. I'll answer. Thank you for your help! Hi I am currently trying to create a form which has one textbox, two radio buttons and a submit button and when the submit button is selected it will open another page and show the text from the text box and also show which radio button was selected. Currently i have two web pages, Forms.html which will have the textbox, radio buttons and submit button. Then i ahve page.html which i want to show the results. Currently the code in the forms.html page is: Code: <form action="page.html" method="post"> <fieldset> <legend>Testing form</legend> <p><label for="name">Name</label> <input type="text" id="name" /></p> <p><label for="male">Male</label> <input type="radio" value="male" id="male" name="gender" /></p> <p><label for="male">Female</label> <input type="radio" value="female" id="Female" name="gender" /></p> <p class="submit"><input type="submit" value="Submit" /></p><br/> </fieldset> </form> On the page.html the code i have is: Code: <% 'declare the variables that will receive the values Dim text, male, female 'receive the values sent from the form and assign them to variables 'note that request.form("name") will receive the value entered 'into the textfield called name name=Request.Form("text") email=Request.Form("male") comment=Request.Form("female") 'let's now print out the received values in the browser Response.Write("text: " & text & "<br>") Response.Write("male: " & male & "<br>") Response.Write("female: " & female & "<br>") %> However when you select the submit button it does open page.html but it does not show the results. Does anyone know why this is? Have i written the code wrong? Thanks Jeskit |