Jump to content

[SOLVED] Help me with Submit


oceans

Recommended Posts

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

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.