Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Dynamic Forms


Message #1 by "Gordon Deudney" <gdeudney@z...> on Tue, 24 Apr 2001 10:38:56 -0700
I was wondering if anyone knew how to create a form that is dynamic.
 When a specific radio button or image is clicked on it will create more
radio buttons or images to select from.  The code below only works in
IE if anyones know how to do this for Netscape as well I would greatly
appreciate it. 
 
Found at 
Original:  Peter Hermus -->
<!-- Web Site:  http://come.to/speedpete -->

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='radio' size=10 name=" + inter
+ "url" + i + inter + "'><br>";
}
if (document.layers) {
document.layers.cust.document.write(data);
document.layers.cust.document.close();
}
else {
if (document.all) {
cust.innerHTML = data;
      }
   }
}
else {
window.alert("Please select up to 15 entries.");
   }
}

  Return to Index