Script Categories













Forms >>> Dynamic Input.

Offer a form with as many input boxes that the user selects. After entering the number of boxes, the form is dynamically updated while the rest of the form remains untouched.

Number of URLs to enter:

Name:
Comments:

Add the below code to the <body> section of your page:

<script language="javascript" type="text/javascript">
/* Visit http://www.yaldex.com/ for full source code
and get more free JavaScript, CSS and DHTML scripts! */
<!-- Begin
function createForm(number) {
data = "";
inter = "'";
if (number < 16 && number > -1) {
for (i=1; i <= number; i++) {
if (i < 10) spaces="      ";
else spaces="    ";
data = data + "URL " + i + " :" + spaces
+ "<input type='text' size=10 name=" + inter
+ "url" + i + inter + "'><br>";
}

document.getElementById('cust').innerHTML = data;
}
else {
window.alert("Please select up to 15 entries.");
   }
}
//  End -->
</script>
<form name=counter>
Number of URLs to enter:
<input type=text name=number size=5>
<input
type=button value="Update" onClick="createForm(document.counter.number.value);">
</form>

<br>

<form name="webform">
<table border=0>
<tr
valign=top>
<td>
Name:</td>
<td>
<input type=text size=20 name=name></td>
</tr>

<tr><td
colspan=2>

<!-- Placeholder for dynamic form contents -->
<span id=cust style="position:relative;"></span>

</td>
</tr>

<tr
valign=top>
<td>
Comments:</td>
<td>
<textarea name=comments cols=45 rows=5 wrap=virtual>
</textarea>
</td>
</tr>
<tr>
<td></td>
<td>
<input type=submit value="Send"></td>
</tr>
</table>
</form>

JavaScript Editor Get Advanced
JavaScript and Ajax Editor,
Validator and Debugger!

1st JavaScript Editor.



Code was highlighted by 1st JavaScript Editor (The Best JavaScript Editor!).

Bitcoin Dice Site . site www.cashadvance-loans.net


©