输入表单对某些旧浏览器没有反应

时间:2022-06-10 17:24:33

I have an input form but it somehow only works on new browsers. For old browsers the submit button just does not react to. What do I have to modify to get the desired output?

我有一个输入表单,但它不知何故只适用于新的浏览器。对于旧浏览器,提交按钮只是没有反应。我需要修改什么才能获得所需的输出?

My code:

我的代码:

<form action="/form-mailer.php" method="post">
<p><label>Gender:* <input name="Gender" type="radio" value="male" /></label> <label>male <input name="gender" type="radio" value="female" /> female</label></p>

<p><label>surname:* <input name="surname" type="text" /></label> <label>name:* <input name="name" type="text" /></label></p>

<p><label><input name="General business terms" type="checkbox" value="general business terms" /> Please confirm our <a href="mydomain.com/gbt" target="_blank">general business terms *</a></label></p>
<input type="submit" value="OK" /></form>

my php code aasked for:

我的PHP代码用于:

if(isset($_POST)) { 

   foreach($_POST as $name => $value) {

      if(is_array($value)) {

          $mailText .= $name . ":\n";

          foreach($valueArray as $entry) {

             $mailText .= "   " . $value . "\n";
          }
      } 

      else {

          $mailText .= $name . ": " . $value . "\n";
      } 
   } 
} 

//corrections

 if(get_magic_quotes_gpc()) {

     $mailtext = stripslashes($mailtext);
 }

// mail 

$mailSent = @mail($mailTo, $mailSubject, $mailText, "From: ".$mailFrom);

// ======= Return-page

if($mailSent == TRUE) {
   header("Location: " . $returnPage);
}
// error-page
else {

   header("Location: " . $returnErrorPage);
}

1 个解决方案

#1


0  

Would be nice if you showed your PHP code as it might be a reason in there. Other thing I can see is the Labels - you are setting the input within them so it should be like:

如果你展示你的PHP代码会很好,因为它可能是一个原因。我能看到的其他东西是标签 - 你在其中设置输入所以它应该是这样的:

<label>Gender:* </label><input name="Gender" type="radio" value="male" />

If you have ID you can set "for" attribute.

如果您有ID,则可以设置“for”属性。

<label for="male">Gender:* </label><input  id="male" name="Gender" type="radio" value="male" />

Also you can try JavaScript or JQuery - something like:

您也可以尝试JavaScript或JQuery - 类似于:

    $(document).ready(function(){
    $('form input[type="submit"]').click(function(){
        $('form').submit();
    });
});

#1


0  

Would be nice if you showed your PHP code as it might be a reason in there. Other thing I can see is the Labels - you are setting the input within them so it should be like:

如果你展示你的PHP代码会很好,因为它可能是一个原因。我能看到的其他东西是标签 - 你在其中设置输入所以它应该是这样的:

<label>Gender:* </label><input name="Gender" type="radio" value="male" />

If you have ID you can set "for" attribute.

如果您有ID,则可以设置“for”属性。

<label for="male">Gender:* </label><input  id="male" name="Gender" type="radio" value="male" />

Also you can try JavaScript or JQuery - something like:

您也可以尝试JavaScript或JQuery - 类似于:

    $(document).ready(function(){
    $('form input[type="submit"]').click(function(){
        $('form').submit();
    });
});