Page 1 of 1

get the value of a textbox to a variable

Posted: Thu Jun 22, 2006 7:46 am
by greeshma
I create one php page for add a course and its modules to database.i have the text field for number of course modules.depends on that number of modules i want to create the table rows using "for" loop.The "for" loops limit is that number of modules.
<input type='text' name='numberofmodules' >
$numberofmodules=????????????????? here how i get the value of the above text box without submitting the form
for($i=1;$i<=numberofmodules;$i++)
{
<tr><td><input type='text' name='sessName' size='15'></td></tr>????????here how i change the name of the textbox depending on the "for" loop???
}

2.After submitting this form how can i get the value of the whole fields.I used post method and i can't get that array value..

3.How we post an array from one php page to another?

Posted: Thu Jun 22, 2006 8:41 am
by Kadanis
PHP is a server side language which means the data in the form must be submited to the server before it can be processed. To access variables in form objects without submitting the form you would have to use a client side language like JavaScript.