HTML - Loops To Generate Forms?
Is it possible to generate a form within a loop. As I want a page that will have 200 form fields so was going to use a javascript loop to generate all 200 but I can not get it to work. Is this possible?
Code: <form action="rename_sensors.htm" method="post"> <table align="center" cellpadding="2"> <tr> <td><b>Sensor address</b></td><td><b>Current Name of Sensor</b></td><td><b>New Name for Sensor</b></td> </tr> <script type="text/javascript"> for(i=0;i<200;i++) { document.write("<tr>"); document.write("gfg"); document.write("<td>~address(0)~ </td>"); document.write("<td>~name(0)~</td>"); document.write("<td><input type="text" name="name[0]" maxlength="16" value="~name(0)~" size="20"></td>"); document.write("</tr>"); } </script> <tr> <td><input type="submit" value="Save"></td> </tr> </table> </form> the fields within ~and~ are got from a webserver dynamically. Many Thanks Similar TutorialsIs there any way to use an xml file and create a link to a new page that has information based on a block of data in the xml file? hi there, my first post here. ok i haven't done development for awhile, and recently i'd designed a layout with adobe photoshop. was wondering what's the quickest way to create the code in html? which software is best and effecient? i usually hand code everything but i'm trying to save time. thanks a bunch!!! Hello. I'm a newbie here. I've been asked to design a web site for a club I'm involved with. Unfortunately they have purchased a cheap hosting package, so I have no Java/JSP, no PHP and no MySql. Pure static pages only. Sigh. I've found a nice looking template I can use - has nice drop down menus for navigation etc. It doesnt use frames. Now, since I want to navigate between half a dozen content pages, it seems that each of my pages has to contain all the common stuff - the menu, sidebars, etc. I'd kill for an <import src="..."/> tag :-) So, are there any design patterns that will allow me to achieve templating of all the menus and common code? Alternatively, are there any code-time coding tools that will generate run-time static pages based on templates? Any advice welcome. Thanks. imo. First of all, sorry, i didn't post it in english because i searched for a forum in my language . Second : I am trying to create a script, that will use the script you can see under this text and auto click a link that is generating itself randomly and changes position, color, letter order every time you want to click it again (the "fight again" link has to be clicked on order to get points by beating up the enemy. This link "fight again" is hard coded.. it even has a brother fake link that carries the same name but get's you elsewhere if you accidentally click it. green. bots2. net is the site... if anyone can help me out by enlightening me up a little, to tell me where I can start to be able to do a script that finds this link and click it repeatedly. Don't point to mouse auto-clickers since these are useless, like I said .. the link is changing color, position and link number: e.g good link : http://green.bots2.net/fight.php?ch_...r&pageid=36079 bad link : http://green.bots2.net/fight.php?ch_...r&pageid=36080 next fight: good link : http://green.bots2.net/fight.php?ch_...r&pageid=25191 bad link : http://green.bots2.net/fight.php?ch_...r&pageid=25190 Here is the site's frame source ======================================== <HTML><HEAD> <link rel="stylesheet" href="bots2.css"> </HEAD> <BODY BGCOLOR="#000000" TEXT="#00cc00" LINK="#99cc00" VLINK="#33cc00"> <CENTER> <H4>B.O.T.S. - The Battle</H4> <h4>Deus Ex Machina vs Petertjuh4</h4> </CENTER> <script> parent.header.fillInfo('Deus Ex Machina','#99aaaa',150,36494,7415,216,2109294,33568093468); </script> <HR size="1" noshade> <script> ah = new Array(); aattempts = 0; dattempts = 0; amaxhit = 0; dmaxhit = 0; amiss = 0; dmiss = 0; ablock = 0; dblock = 0; function fl(hitter, hit, hitweapon) { return parent.FightLine(hitter, hit, hitweapon); } function ShowHit(i,chid,opps,fid,nid,chlvl) { if (!ah) return; line = ah[i]; if (i<ah.length-1) { document.all('arena').innerHTML += line; document.all('endpage').scrollIntoView(true); i++; nexthit = 'ShowHit('+i+','+chid+',\''+opps+'\',\''+fid+'\',\''+nid+'\','+chlvl+')'; setTimeout(nexthit, 800); } else { if (ddamage>dmaxhp) { winner = a; } else { winner = d; } document.all('arena').innerHTML += line; if (aattempts+dattempts>0) { document.all('arena').innerHTML += parent.Report(); } document.all('arena').innerHTML += report; geel = '#' + (parseInt(Math.random()*150)+100).toString(16) + (parseInt(Math.random()*150)+100).toString(16) + (parseInt(Math.random()*150)+100).toString(16); if (parseInt(Math.random()*2)) { toright = '<font color="'+geel+'">></font>'; toleft = '<'; } else { toright = '<font color="'+geel+'">»</font>'; toleft = '«'; } fakeagain1 = '<p><font color="black">----</font><a href="fight.php?ch_id='+chid+'&opps='+opps+'&pageid='+fid+'"><span id="a1">Fight this bot again</span></a></p>'; fakeagain2 = '<p><font color="black">-</font><a href="fight.php?ch_id='+chid+'&opps='+opps+'&pageid='+fid+'"><span id="a2">Fight this ot again</span></a></p>'; fightagain1 = '<p><font color="black">---</font><a href="fight.php?ch_id='+chid+'&opps='+opps+'&pageid='+nid+'"><span id="a1">Fight this bot again</span></a>'; fightagain2 = '<p><font color="black"></font><a href="fight.php?ch_id='+chid+'&opps='+opps+'&pageid='+nid+'"><span id="a2">Fight this bot again</span></a>'; grijs = '#' + '0' + (parseInt(Math.random()*16)).toString(16) + '0' + (parseInt(Math.random()*16)).toString(16) + '0' + (parseInt(Math.random()*16)).toString(16); //geel = '#' + (parseInt(Math.random()*16)+188).toString(16) + (parseInt(Math.random()*16)+240).toString(16) + (parseInt(Math.random()*16)+86).toString(16); //groen = '#' + '0' + (parseInt(Math.random()*16)).toString(16) + (parseInt(Math.random()*16)+240).toString(16) + (parseInt(Math.random()*16)+86).toString(16); groen = geel; backlink = '<p><font color="black">-----</font><a href="fight_index.php?page='+chlvl+'&opps='+opps+'"><font color="'+groen+'"><span id="bl">Back to the fight list</span></font></a></p>'; if (parseInt(Math.random()*2)) { if (torape) { torape--; fightagain2 += ' ('+torape.toString()+' to rape limit)'; } fightagain2 += '</p>'; if (parseInt(Math.random()*2)) { fightagain = fakeagain1 + fightagain2 + backlink; } else { fightagain = fakeagain1 + backlink + fightagain2; } document.all('arena').innerHTML += fightagain; a1.style.color=grijs;a2.style.color=geel; } else { if (torape) { torape--; fightagain1 += ' ('+torape.toString()+' to rape limit)'; } fightagain1 += '</p>'; if (parseInt(Math.random()*2)) { fightagain = fightagain1 + backlink + fakeagain2; } else { fightagain = backlink + fightagain1 + fakeagain2; } document.all('arena').innerHTML += fightagain; a2.style.color=grijs;a1.style.color=geel; } a1.style.textDecoration='none';a2.style.textDecoration='none'; bl.style.textDecoration='none'; //document.all('arena').innerHTML += backlink; document.all('endpage').scrollIntoView(true); } } adamage = 0; ddamage = 0; amaxhp = 0; dmaxhp = 0; a='<font color="#99aaaa">Deus Ex Machina</font>';d='<font color="#aa11ff">Petertjuh4</font>';awr='doom maul';awl='doom maul';dwr='thunder hammer';dwl='thunder hammer';amaxhp=1250;dmaxhp=600;ah[0] = fl(d,92,dwr);ah[1] = fl(a,795,awr);ah[2] = fl(a,754,awl);torape=0;report = '<p>The battle is over. Petertjuh4 is destroyed.</p><p>The B.O.T.S. Union takes 1 kudos from Petertjuh4 and gives it to the winner, Deus Ex Machina.<br>You now have 2,109,295 kudos.</p><p>Your bot gains 11,617 experience points + 5,808 diplomacy bonus (2,202,699,269 xp to next level).</p><p>Auto-repair : No repair costs have been deducted. </p>';</script> <span id="arena" class="p"></span> <span id="endpage"></span> <script> ShowHit(0,188832,'war','94400','94399',150); //parent.ShowHit(0,188832,'war','94400','94399',150); </script> <p><font color="#cc4444"> </font></p> </BODY> </HTML> ========================================= Page info TYPE : text/html Render Mode : Quirks mode Encoding : ISO-8859-1 =========================================== THANK YOU FOR YOUR TIME! Hello, I am a newbie to HTML. I am trying to generate HTML code as a basis to an email. I wish to have a image at the top of the page (page wide 780 pixels) two lines in the sides (based on colored line image) and an image at the button. My problem is: how can I add an image to the left side and the left side of the body part and add text/tables/images etc. between them so it's length will dynamically shorten/lengthen according to the body number of lines ? Thank you for your help Hi, well I didn't know where to post this, but it's about coding and HTML so I think this is it. I would like to add audio (a MP3 file) to my web page, but I have no idea how to do this by HTML. I would like to know: 1.- How do I add a music file (HTML) 2.- Which is the code for the On and Off button. 3.- How exactly do I use frames (i'm totally new in that aspect) in order to have the same music going on in every part of the site even if I change of page instead of strating over agian. Thanks for your help. Hey Guys, Firstly I'm very new to using HTML and "programming" general, so I'm sorry if I come across as dumb New to the forum also and signed up as I couldn't fine help elsewhere on this problem. I'm attempting to write a simple HTML form that will eventually print to a .txt file. The basics of it is d: <input type="text" name="hnmr_shift1" /> H's: <input type="text" name="h_s1" /> Multiplicity: <input type="text" name="multiplicity1" /> J coupling:<input type="text" name="j_coupling1" /> <br /> which is repeated and repeated over and over (about 25 times) I was wondering if there's a to have the user select how many of these they would like (in a drop down box or something along those lines) and it will pop up with x amount of rows of the above boxes. i.e if the user selects 3 you would see something like d : (box) H's : (box) Multiplicity : (box) J coupling : (box) d : (box) H's : (box) Multiplicity : (box) J coupling : (box) d : (box) H's : (box) Multiplicity : (box) J coupling : (box) I've seen similar things on forms were it asks you something like "how many people...." and when you select a number it will pop up with separate boxes for each persons name and details (first name, second name phone number etc.). was thinking of using javascript or something along those lines hope this makes sense. cheers Aaron ps. I want to avoid php as this form will be running on school computers and I cbf setting up a server etc. for it to run. the idea of the form is that it can be booted easily from a USBDrive without any problems or permission issues. Hi there, I have inserted a form into my website using FP2000. I have all the fields I need; Name, City etc..But I don't quite understand how to make the "Submit" and "Reset" button work. I would also like to know how I can make some fields neccessary, so the person may not submit without entering information in required fields..help please! hey guys im having trouble understanding how forms work. i know how to make forms
Code: <form action=""> Username: <input type="text" name="username"><input type="button" value="Check Availability"> <br /> <p></p> Password: <input type="password" name="password"> <br /> <p></p> Confirm Password: <input type="password" name="confirmpass"> <br /> <p></p> E-mail Address: <input type="text" name="email"> <br /> <p></p> Confirm E-mail: <input type="text" name="confirmemail"> <br /> <input type="submit" value="submit"><input type="reset" value="reset"> </form> but i dont really understand how to send that information to a different file, then later be able to get that information from the file and "log in". any help would be nice I have a question about forms. What I want to do is make it so that when somebody types something into a text feild and presses 'sumbit', whatever they typed in will appear in a specific place on the page. What I mean is that if somebody typed in their name, it would go to a page that says Hello, (Whatever was just typed). I've been looking everywhere for a code for this but I've come up with nothing. Can somebody help? I need help with a form that allows the user to enter and submit the information, and then that information that they enter is automatically dislplayed below on the same page, after they hit the submit button. Here is the code I have. Here is the html code (comment.html) <html> <body> <form action="post.php" method="post"> First Name: <input type ="text" name="firstname"/>   Last Name: <input type ="text" name="lastname"/> <br/> <br/><dd/> Comments orSuggestions: <br/><dd/> <textarea name="comment" rows="10" cols="50"></textarea> </textarea> </form> </body> </html> Here is the php code (post.php) <?php $firstname=$_GET['firstname']; $lastname=$_GET['lastname']; $comment=$_GET['comment']; echo $firstname; echo "&4nbsp; $lastname"; echo ":"; echo " $comment"; ?> I do not want the the info when submitted to be displayed on the php page, I want it displayed on the html page where it was submitted, I was told I needed a php page to do that, but I cannot get it to work. Hey I'm new to these forums and fairly new to html. I have a question about forms that everybody here probably be knows, but I'm new, so... here it goes. 1. How do I make a submit button that will submit the data entered in the forms before the submit button and send it to me? If I'm not clear enough just ask and I'll try to re-explain myself. I need to do a form submission that assigns values to radio buttons. Basically its a subjective hearing test, like this one. http://www.entnet.org/healthinfo/hea...aring_test.cfm My question is I don't know how to setup the form at the point of submission, so it returns the proper response, dependent on the selected buttons(or score)? Does anyone have a clue? Thanks in advance... Hello and thank you for having such a good resource for html online. I am trying to accomplish something and am not sure how to go about doing it. What I need to do is have a box that has multiple check boxes with I guess you can call them responses next to them. When the boxes are checked, I would like to be able to have a next button, that would bring me to another set of check boxes and of course answers. At the end of all of this, I would like to have whatever was checked put into a box at the end, that could be copy and pasted into another document. I am basically trying to make a function at my job easier. I have seen it done before, but am not sure what it would be called. I have dabbled a bit with html and for the life of me cannot figure it out. Not looking for someone to do this for me or even walk me through it, but just a point in the right direction. Thanks in advance. Hi, I currently have an area on my site where people can change the look using CSS in a text area. I now want to do it so i use a dropdown box and when someone selects a style they like it calls a CSS theme and puts it into the head of the page. Is this possible (sorry if i have it in the wrong section!) Joe I need help using a code to do the following: I have a search field, when someone types their serial number into the box it needs to bring the specs up for their computer. Currently i am using a code that is simply if this is typed it goes to this page. As the list of serial numbers grows the list becomes larger and larger. Is there a way to either make this an external file where i can update the one file instead of the actual page it is on or is their a simpler way to do this with maybe PHP, SQL or something else that would make this easier to update? I need help writing a form...i know how to do everything but have it sent to my email address. Can somebody give me or help me write a CGI program that will send it to my email address. Thank you very much Okay, I'm trying to make a form that sends the information entered to my email address. I don't know if it's the code or not but all it seems to be doing is opening up a blank email directed to the address. Here's the code: <form action="MAILTO:lifeisbetteroutsidethebox@hotmail.com" method="post" enctype="text/plain"> <p align="center"><strong>Your Full Name:</strong><br /><input name="name" type="text" class="style8" size="20"> </p> <p align="center"><strong>Your Email Address:</strong><br /> <input name="mail" type="text" class="style8" size="20" /> </p> <p align="center"><strong>Your City:</strong><br /> <input name="city" type="text" class="style8" size="20" /> <p align="center"> <input name="Send" type="submit" id="Send" value="Send"> <input name="Reset" type="reset" id="Reset" value="Reset"> </form> Okay, any help please? i'm busy creating a form but, if i hit the send button i can only send it to e-mail. I want to have it so that if something is submitted it shows it on the page itself, Like if you make a offer on a site where you can buy stuff so other people on the site know what the highest offer is. But i dont know the code can someone plz help me |