By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,567 Members | 1,134 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,567 IT Pros & Developers. It's quick & easy.

Simple Javascript Array

P: n/a
We need to post the contents of textboxes to a php file as an array.
Does anyone know how to do it?

Cheers
Phil.

Heres the code (which works, but doesnt post to into an array)

<head>
<script type="text/javascript">
function CheckDropDown(val)
{
var phil = parseInt(val);
document.write("<table border=\'0\' width=\'100%\' id=\'table1\'
cellspacing=\'0\' cellpadding=\'0\' bgcolor=\'#FFE1FF\'>");
for (i=1;i<=phil;i++)
{
this.document.write("<TR><TD width=\'200\'>Box No: " + i +
"</td><td><input type=\'text\' name=\'Box"+i+"\'
size=\'20\'></td></tr>");
}
document.write("</table>");
}
</script>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" name="form1">
<!--webbot bot="SaveResults" U-File="D:\Projects\City Car
Club\_private\form_results.csv" S-Format="TEXT/CSV"
S-Label-Fields="TRUE" -->
<p>&nbsp;</p>
<p>Is your partner a member? <select size="1" name="Partner_List"
onchange="CheckDropDown(this.value);return false">
<option selected value="please select">please select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="50000">50000</option>
</select></p>
<p>&nbsp;</p>
</form>
</body>

Oct 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

<go****@budget-edi.co.uk> wrote in message
news:11*********************@g14g2000cwa.googlegro ups.com...
We need to post the contents of textboxes to a php file as an array.
Does anyone know how to do it?

Cheers
Phil.

Heres the code (which works, but doesnt post to into an array)

<head>
<script type="text/javascript">
function CheckDropDown(val)
{
var phil = parseInt(val);
document.write("<table border=\'0\' width=\'100%\' id=\'table1\'
cellspacing=\'0\' cellpadding=\'0\' bgcolor=\'#FFE1FF\'>");
for (i=1;i<=phil;i++)
{
this.document.write("<TR><TD width=\'200\'>Box No: " + i +
"</td><td><input type=\'text\' name=\'Box"+i+"\'
size=\'20\'></td></tr>");
}
document.write("</table>");
}
</script>
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" name="form1">
<!--webbot bot="SaveResults" U-File="D:\Projects\City Car
Club\_private\form_results.csv" S-Format="TEXT/CSV"
S-Label-Fields="TRUE" -->
<p>&nbsp;</p>
<p>Is your partner a member? <select size="1" name="Partner_List"
onchange="CheckDropDown(this.value);return false">
<option selected value="please select">please select</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="50000">50000</option>
</select></p>
<p>&nbsp;</p>
</form>
</body>
you dont have a text box on this page just one dropdown which will give you
one value, hardly worth creating and array for this !!

Oct 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.