Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7158047
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T12:59:45+00:00 2026-05-28T12:59:45+00:00

I have a form setup but for some reason the JS to submit the

  • 0

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.

Here is my submit button –

<a href="javascript: validate(); return false;"><img type="submit" src="lib/send_feedback.jpg" border="0" class="feedback-submit-img" /></a>

Here is what JS it calls

// 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 = /^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\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);

For the second part of my issue which may or may not be related to the JS issue is –

echo $POST['satisfaction'];
echo $POST['user_email'];
echo $POST['comments'];
if(isset($POST['user_email'])){
    echo 'true';
} else {
    echo 'false';
}

If you would like a better look at the page I am editing here is a link to jsfiddle

edit

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.

Here is the complete source with George requested. – index.php

Page source gets passed to – feedback-accept.php

Also with that being said/posted, what is StackOverflow’s preferred site to post source to?

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T12:59:46+00:00Added an answer on May 28, 2026 at 12:59 pm

    In a quick look, I would say you are having a conflict of functions here. When you design a Submit Type, you are telling the browser that that will submit your form (on its action), on the other hand, that is inside a link that is calling a JS function. If you’re manufacturing the submit in your JS, try to consider not use a Submit Type and see if it works more properly.
    You might also try to replace the link for a simple “onSubmit” inside the form’s Tag and call the JS function from there. This way, when the browser identifies that the user hit the submit button, he’ll call a JS Function as you wish and if this function returns true, the submit will be allowed by the browser.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form I set to Maximized , but for some reason it's
i have form action file in another directory but some file send to this
I have bassistance jquery-plugin-autocomplete setup and working fine for FF and chrome but with
I have setup some automatic form submission code. Basically when a form is submitted
I have a project to setup an anonymous feedback form to our website. I
We have got a setup where users can either use a web-based form or
I have form area in my view. If I click button A , I
We have some html that looks like this: <form id=MyUserControl runat=server method=post> <script language=javascript
I have a form which for some questions would ask if something was included
I'm not a Notes programmer, however, for my sins, have been working on some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.