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 496101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:39:15+00:00 2026-05-13T05:39:15+00:00

I have the code below and everything works but the button click function on

  • 0

I have the code below and everything works but the button click function on IE I have played around and still cannot seem to get it working.

$(document).ready(function() 
{
$("img").hide();
$("#logo").show();
document.getElementById("fname").focus();
$(".button").click(function() 
{    
    postdata();
});         

})

function postdata()
{   

var parameters = 'fname=' + document.getElementById("fname").value + '&lname=' + document.getElementById("lname").value;
httpxml.onreadystatechange = stateck;       
httpxml.open('POST', '../checking/submitcheck.php', true);
httpxml.setRequestHeader('Content-Type', "application/x-www-form-urlencoded");
httpxml.setRequestHeader('Content-Length', parameters.length);
httpxml.send(parameters);

function stateck() 
{

if(httpxml.readyState==4)

{ 
    if (httpxml.responseText.indexOf("Successful") >= 0)
    {   
        $("#result").show("slow");
        $("#result").html("Project request has successfully been sent");
        $("#result").removeClass("result_error");

    }
    else if (httpxml.responseText.indexOf("Fail") >= 0)
    {
        $("#result").html("One or more errors have occured, please fix and submit again");
        $("#result").addClass("result_error");
        $("#result").show("slow");              

    }   
}

}   
}

Any idea?

Thanks =)

edit: submit button code

<input type="submit" name="button" class="button" id="button" value="Submit" disabled="disabled" onclick="return false;" />
  • 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-13T05:39:16+00:00Added an answer on May 13, 2026 at 5:39 am

    Since you’re already using jQuery you might as well go all the way with it…

    Try changing your postdata() function to this…

    function postdata(){
      $.ajax({
        type: "POST",
        dataType: "text",
        url: "../checking/submitcheck.php",
        data: "fname=" + $("#fname").val() + "&lname=" + $("#lname").val(),
        cache: false,
        success: function(resp){
          if (resp.indexOf("Successful") >= 0){
            $("#result").show("slow");
            $("#result").html("Project request has successfully been sent");
            $("#result").removeClass("result_error");
          }
          else if (resp.indexOf("Fail") >= 0){
            $("#result").html("One or more errors have occured, please fix and submit again");
            $("#result").addClass("result_error");
            $("#result").show("slow");                            
          }
        }
      });
    }
    

    This way jQuery takes care of all the browser checking for you and creates the proper object for making the http post. Look here for more details about it http://docs.jquery.com/Ajax/jQuery.ajax#options

    If you’re not going to reuse the postdata() function anywhere else there isn’t any reason you couldn’t just put all of the above code into the anonymous function declared for the $(“.button”).click() event.

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

Sidebar

Related Questions

I have code below: <select id=testSelect> <option value=1>One</option> <option value=2>Two</option> </select> <asp:Button ID=btnTest runat=server
I have code that looks more or less like the code below but it
I have this code below: <?php function wp_copickpage() { color_option_update(); ?> <form method=POST action=>
I have used a Asynchronous TCP/IP server, everything works fine but when a client
In my code below, I have a function that asynchronously loads all files necessary
I have code to create another row (div with inputs) on a button click.
EDIT: I have figured out my main issue, but still have one concern. Everything
I have code as below: var s : String = hello world var xml
I have the code below. It looks long and complicated and now I have
I have the code below. void *timer1_function(void * eit); pthread_t timer1; int thread_check1 =

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.