JakeSilver Posted July 14, 2008 Share Posted July 14, 2008 Hi there, I am having trouble with some text boxes and have given then numerical names? Can textboxes have there names as just numbers? Many Thanks Jake Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/ Share on other sites More sharing options...
JasonLewis Posted July 14, 2008 Share Posted July 14, 2008 Yes you can. Worked for me. Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589407 Share on other sites More sharing options...
waynew Posted July 14, 2008 Share Posted July 14, 2008 Be very wary of dynamic forms. Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589412 Share on other sites More sharing options...
JakeSilver Posted July 14, 2008 Author Share Posted July 14, 2008 This is a dynamic form and i am not having any luck at all. Im trying to assign a text box to a record in the database. i shall show some code : <?$sectionquery=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC"); while($data=mysql_fetch_object($sectionquery)){ echo "<p>$data->name<input type='text' value='' name='$data->textcode' size='4'></p> "; } $data->textcode is a ten digit number if ($_POST['Submit']){ $numsec=mysql_query("SELECT * FROM `section` ORDER BY 'id' ASC")or die (mysql_error()); while($secdata=mysql_fetch_object($numsec)){ $boxcode=$secdata->textcode; echo $boxcode; $navvalue= $_POST['$boxcode']; echo" this is nav value $navvalue"; When i echo $boxcode it appears as the same number as $data->textcode which is correct However it does not get the value of the textbox Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589418 Share on other sites More sharing options...
JasonLewis Posted July 14, 2008 Share Posted July 14, 2008 Try this: $navvalue= $_POST[$boxcode]; Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589422 Share on other sites More sharing options...
JakeSilver Posted July 14, 2008 Author Share Posted July 14, 2008 Thankyou Greatly Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589425 Share on other sites More sharing options...
waynew Posted July 14, 2008 Share Posted July 14, 2008 I try to stay as far away from dynamic forms as possible. They are a complete pain in the you know what. Link to comment https://forums.phpfreaks.com/topic/114637-can-the-name-of-a-textbox-be-numbers/#findComment-589430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.