Note that there are some explanatory texts on larger screens.

plurals
  1. POSubmit button not working in IE/Safari, works in Chrome but form info is not getting passed
    primarykey
    data
    text
    <p>I have a form setup but for some reason the JS to submit the form works in Chrome but not IE9 or Safari. Interestingly enough in Chrome where the submit button does work none of the information gets passed.</p> <p>Here is my submit button -</p> <pre><code>&lt;a href="javascript: validate(); return false;"&gt;&lt;img type="submit" src="lib/send_feedback.jpg" border="0" class="feedback-submit-img" /&gt;&lt;/a&gt; </code></pre> <p>Here is what JS it calls</p> <pre><code>// Submit form to next page function submitForm() { // document.forms["feedbackform"].submit(); document.feedbackform.submit(); } // Submit form and validate email using RFC 2822 standard function validateEmail(email) { // Modified version original from: http://stackoverflow.com/a/46181/11236 var re = /^(([^&lt;&gt;()[\]\\.,;:\s@\"]+(\.[^&lt;&gt;()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/; return re.test(email); } // Return true if email field is left unchanged function originalText(email){ var defaultMsg; defaultMsg = "Enter your email address (optional)"; if(defaultMsg == email){ return true; } return false; } // Verify or decline with error message function validate(){ $("#result").text(""); var email = $("#email").val(); if ((validateEmail(email)) || originalText(email)) { submitForm(); } else { $("#result").text(email + " is not a valid email."); $("#result").css("color", "red"); } return false; } $("form").bind("submit", validate); </code></pre> <p>For the second part of my issue which may or may not be related to the JS issue is -</p> <pre><code>echo $POST['satisfaction']; echo $POST['user_email']; echo $POST['comments']; if(isset($POST['user_email'])){ echo 'true'; } else { echo 'false'; } </code></pre> <p>If you would like a better look at the page I am editing <a href="http://jsfiddle.net/nC6TW/1/" rel="nofollow">here is a link to jsfiddle</a></p> <p><em>edit</em></p> <p>As per Marco's request I removed the link from around the submit button and placed the onClick event onto the actual button itself. This absolutely fixed the issue on both IE and Safari. Now my remaining question/concern is why the POST data is not passing correctly to the next page.</p> <p><a href="http://pastie.org/private/ngh7pndwb72twncryku1ma" rel="nofollow">Here is the complete source with George requested.</a> - index.php</p> <p><a href="http://pastie.org/3245113" rel="nofollow">Page source gets passed to</a> - feedback-accept.php</p> <p>Also with that being said/posted, what is StackOverflow's preferred site to post source to?</p> <p>In response to Brian's comment, if I cannot use failed without potentially breaking the POST data, what would be a good alternative/work-around?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload