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

  • SEARCH
  • Home
  • 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 7514323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T00:27:42+00:00 2026-05-30T00:27:42+00:00

I havent quite found an answer that works for my exact function so here

  • 0

I havent quite found an answer that works for my exact function so here it goes

I wrote a quick function that should send values to an external php file and load the result into a div.. that works fine for 1 form input – what is the best way to get all the form inputs from the form and pass them through the php file and load the results? serialize? how would I implement it??? 🙂

$(function() {  
    function showLoader(){
        $('#results .loader').stop(true,true).fadeIn(200);
    }
    //hide loading bar
    function hideLoader(){
        $('#results').fadeIn(1500);
        $('#results .loader').fadeOut(200);
    };
    $('#submit').keydown(function(e) {
      if(e.keyCode == 13) {
        showLoader();
        $('#results').fadeIn(1500);
        $('#results').load('/patientform.php?val=' + $('#patientSearchForm input').val(), hideLoader());
        e.preventDefault();
      }
      });     
    $('#submit').click(function(){  
        //show the loading bar
        showLoader();
        $('#results .loader').fadeIn(1500);      
        $('#results').load('/patientform.php?val=' + $('#patientSearchForm input').val(), hideLoader());

    });
});
  • 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-30T00:27:43+00:00Added an answer on May 30, 2026 at 12:27 am

    Just change it to use serialize. But I think a more generic function can be more usefull:

    function postForm(formId, callback) {
        $(formId).on("submit", function(){
            $.ajax({
                url: "url/GoesHere",
                data: $(this).serialize(),
                success: function(data) {
                    // request succeeded
                    if (callback) callback.apply(data);
                },
                error: function(xhr) {
                   // request error
                   alert(xhr.responseText);
                }
            });
    
            return false;
        })
    };
    

    You can use it to bind the event on every form you want on DOM ready.

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

Sidebar

Related Questions

I've searched through the site and haven't found a question/answer that quite answer my
I've searched all over and havent quite found the answer for my particular question.
I have searched Google and looked here but I haven't quite found the answer
I know it's been asked around but I haven't found quite the answer yet
I've read around quite a bit but haven't found a definitive answer. I have
Sorry if this is a dup; I haven't found any questions that pose quite
I've been looking around Google and SO and haven't quite found an answer to
I searched (trust me!) but for some reason, haven't quite found the answer I'm
I've searched my problem high and low on here and haven't quite found the
My question may seem quite simple but I haven't found the answer yet. In

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.