hi,
i want to develop a application....
where the user can enter the no of text boxes he wants..in the next page based on the user input it should disply the text boxes with different id
use javascript,
when the user enters data into first textbox, add there automatically another textbox n name it text02, keep this process and on post just catch the data. thats all.
for($i=0;$i < $_SESSION[tboxes];$i++){
$txtboxname = $txt.$i;
echo $txtboxname;
$textbox_value .= $_REQUEST[$txtboxname] ;
$textbox_value .= "<br>"; //one value per line
echo $textbox_value;
}
}
hi, there's a mistake in my earlier code
here's the right one ( i've tried it)
first u must make a hidden field in your form for number of textbox
example "<input name="textbox_num" type="hidden" value="10">" (value automatically fill based on user request)
if($_POST[Submit]) { //if user submit your form
$textbox_value = ""; //initiate value for result
for($i=0;$i < $textbox_num ;$i++){
$txtboxname = "txt".$i; //no $ sign in txt
$textbox_value .= $_POST[$txtboxname]."<br>";
}
echo "value = $textbox_value"; //print result after "for" loop
}
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.