oceans Posted October 10, 2007 Share Posted October 10, 2007 Dear People, This is funny! Mouse click on "submit" works, but not when I put an entry and push "Enter" on via the keyboard. (But we can't stop user right) Can you help me, stick this on your pc and try! (Test.php) <?php ob_start(); ?> <head> </head> <body> <?PHP $NumberOfTxtBoxes=1; $NumberOfTxtBoxesMustBeFilled=1; //Transfer Data from Screen to Memory if (isset($_POST['Submit'])) { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=$_POST["Txt".$i]; } } else { for ($i=1; $i<=$NumberOfTxtBoxes; $i++) { $InputFromScreen[$i]=""; } } ?> <form id="form1" name="form1" method="post" action="Test.php"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><table width="765" border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td><table width="755" border="0" cellpadding="5" cellspacing="0"> <tr> <td> </td> </tr> <tr> <td width="745"><table width="745" border="0" cellpadding="5" cellspacing="0"> <tr> <td width="170" class="FieldName">ID Number</td> <td width="555" class="FieldName"><input name="Txt1" type="text" class="FieldValue" id="Txt1" value="<?PHP echo $InputFromScreen[1]; ?>" size="13" maxlength="12"/></td> </tr> <tr> <td class="FieldName"> </td> <td class="PHPRunTime"><?PHP $TxtBoxesNotFullyFilled=0; for ($i=1; $i<=$NumberOfTxtBoxesMustBeFilled; $i++) { if ($InputFromScreen[$i]=="") { $TxtBoxesNotFullyFilled=1; break; } } if ($TxtBoxesNotFullyFilled==1) { echo "Field Should be Filled!"; } else { if ($InputFromScreen[1]==1) { echo "You typed 1"; } else { echo "You DID NOT typed 1"; } } ?> </td> </tr> <tr> <td class="FieldName"> </td> <td class="FieldValue"><input name="Submit" type="submit" id="Submit" value="Submit" /></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td> </td> </tr> </table> </td> </tr> </table> </form> </body> </html> Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/ Share on other sites More sharing options...
darkfreaks Posted October 10, 2007 Share Posted October 10, 2007 can you lowercase the PHP to php so we can see it in color ??? Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365827 Share on other sites More sharing options...
onenonly Posted October 10, 2007 Share Posted October 10, 2007 It works for me when i click enter on the keyboard Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365829 Share on other sites More sharing options...
oceans Posted October 10, 2007 Author Share Posted October 10, 2007 Ouch, It does not work in my WAMP in my home PC and also my linux server my space provider. In Both cases I use IE7 on XP PC as the browser. Do you think I need twitching Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365833 Share on other sites More sharing options...
oceans Posted October 10, 2007 Author Share Posted October 10, 2007 Hello, Any one want to try this and help me Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365853 Share on other sites More sharing options...
MadTechie Posted October 10, 2007 Share Posted October 10, 2007 STEPs 1. remove the id="Submit" and it will work fine.. 2. then delete IE from your PC 3. and every PC you see from now on... or just do step 1 Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365860 Share on other sites More sharing options...
oceans Posted October 10, 2007 Author Share Posted October 10, 2007 MadTechie, I confirm it is with IE, because OPRA and FIREFOX is doing OK. You suggestion (1) did not work yet. Can we do a some twitching? Surprise, when I hav two or more inputs it is fine with IE but one input I have this problem, I can't control users. help Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365867 Share on other sites More sharing options...
MadTechie Posted October 10, 2007 Share Posted October 10, 2007 the best route would be to change if (isset($_POST['Submit'])) to if (isset($_POST)) it will work but do you have more that one button on your final project ? Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365883 Share on other sites More sharing options...
oceans Posted October 10, 2007 Author Share Posted October 10, 2007 YES " if (isset($_POST)) " works! I only have one button for all single input pages, but I do have two button pages as well, but incidently, each button addresses a few dedicated inputs each. Will I have new problem by implanting your solution? Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-365888 Share on other sites More sharing options...
MadTechie Posted October 10, 2007 Share Posted October 10, 2007 well not really as with 2 buttons your need to choose one of them Link to comment https://forums.phpfreaks.com/topic/72549-solved-help-me-with-submit/#findComment-366028 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.