apowers20
07-07-2005, 12:34 AM
Hi All,
JavaScript noob here :)
What I'm trying to do is I'm sure simple:
When a user selects a radio button a table is created with data that is displayed on the same page as the rest of the website content.
What I have written to do this is:
function fourUp ()
{
var four_up = new Array (12)
four_up[0] = 4;
four_up[1] = 8;
four_up[2] = 12;
four_up[3] = 16;
four_up[4] = 20;
four_up[5] = 24;
four_up[6] = 32;
four_up[7] = 40;
four_up[8] = 60;
four_up[9] = 80;
four_up[10] = 100;
four_up[11] = 120;
this.document.write ("<fieldset> <legend>Number of Pads Ordered:</legend>");
for (i=0; i<12; i++)
{
this.document.write ("<input type=radio name=quantity value=i>"+ four_up[i] +"  ");
}
this.document.write ("<br>");
this.document.write ("<input type=radio name=quantity value=other ><span class=stdfnt>Other <input class=TEXT type=text name=quantityo size=5 max_length=5 value=></span>");
this.document.write ("</fieldset>");
}
What happens is: A new page is created with my data being loaded into the fieldset, but I want it to be loaded on the current page and in a placement of my liking. Is there any way to do this?
I would really appreciate any insight or maybe other suggestions on how to do this. Thank you all.
JavaScript noob here :)
What I'm trying to do is I'm sure simple:
When a user selects a radio button a table is created with data that is displayed on the same page as the rest of the website content.
What I have written to do this is:
function fourUp ()
{
var four_up = new Array (12)
four_up[0] = 4;
four_up[1] = 8;
four_up[2] = 12;
four_up[3] = 16;
four_up[4] = 20;
four_up[5] = 24;
four_up[6] = 32;
four_up[7] = 40;
four_up[8] = 60;
four_up[9] = 80;
four_up[10] = 100;
four_up[11] = 120;
this.document.write ("<fieldset> <legend>Number of Pads Ordered:</legend>");
for (i=0; i<12; i++)
{
this.document.write ("<input type=radio name=quantity value=i>"+ four_up[i] +"  ");
}
this.document.write ("<br>");
this.document.write ("<input type=radio name=quantity value=other ><span class=stdfnt>Other <input class=TEXT type=text name=quantityo size=5 max_length=5 value=></span>");
this.document.write ("</fieldset>");
}
What happens is: A new page is created with my data being loaded into the fieldset, but I want it to be loaded on the current page and in a placement of my liking. Is there any way to do this?
I would really appreciate any insight or maybe other suggestions on how to do this. Thank you all.