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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T12:17:38+00:00 2026-06-08T12:17:38+00:00

I want to preface this with, I’m a total noob so please explain like

  • 0

I want to preface this with, “I’m a total noob so please explain like I’m five.” I’ve looked at a lot of answers to this common question but I was unable to find a suitable answer to my particular problem. Below is the scripty bit in question. Currently, the user inputs an order number. This gets sent via the ajax call to a php processor script. The processor script validates the order number and then sends data back. If data !=”NO” we get sent to a new page.

<script type="text/javascript">
function resetTextFields()
{
    $("#orderNum").val("");                
}

function onSuccess(data, status)
{
    resetTextFields();
    // Notify the user the new post was saved
    $("#message").fadeIn(2000);
    data = $.trim(data);
    if(data != "NO")
    {
        location.href="labOrders.php";
    }
    else
    {
        $("#message").css("background-color", "#ff0000");
        $("#message").text("Not a valid order number...");
    }
    $("#message").fadeOut(2500);
}

$(document).ready(function() {
    $("#submitSearch").click(function(e){

        var formData = $("#labOrderFind").serialize();

        $.ajax({
            type: "POST",
            url: "labSearch.php",
            cache: false,
            data: formData,
            success: onSuccess
        });

        e.preventDefault();
    });


});

What I would like to do is onSuccess if data!=”NO”, POST the formData again to the labOrders.php so that labOrders.php can use it to do more lookups against a db. I’ve tried to do this many ways but I’ve not been successful. Am I going about this the wrong way? As long as we can use POST, I’m open to all solutions.

Extra info:
jquery and jquery.mobile are loaded in the head (it’s a tablet app).

Maybe stackoverflow needs a noob tag for questions like this.

  • 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-06-08T12:17:39+00:00Added an answer on June 8, 2026 at 12:17 pm

    I solved my own problem. Below is my solution in case someone else runs into a problem like this in the future.

    I found this function.

    function post(URL, PARAMS) {
        var temp=document.createElement("form");
        temp.action=URL;
        temp.method="POST";
        temp.style.display="none";
        for(var x in PARAMS) {
            var opt=document.createElement("textarea");
            opt.name=x;
            opt.value=PARAMS[x];
            temp.appendChild(opt);
        }
        document.body.appendChild(temp);
        temp.submit();
        return temp;
    

    }

    I then slightly modified my onSuccess function:

        function onSuccess(data, status)
    {
        data = $.trim(data);
        if(data != "NO")
        {
                        post("labOrders.php", {
                            orderNum:data
                        })
        }
        else
        {
                resetTextFields();
            $("#message").css("background-color", "#ff0000");
            $("#message").text("Not a valid order number...");
        }
        $("#message").fadeOut(2500);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to preface this by saying I'm a noob with WPF/.net programming. Here
I want to preface this question by stating that I am fairly new to
I'll preface this question with the note that I have looked at this similar
I want to preface this question with the fact that I am a student
I want to preface this by saying I believe the Right™ Way to handle
Let me preface this post with a single caution. I am a total beginner
I'll preface this by saying it's a homework assignment. I don't want code written
Before the question, let me preface this with the fact that I am working
(Preface: this question is about ASP.NET MVC 3.0 which was released in 2011 ,
I must preface this by saying that I am a neophyte (learning), so please

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.