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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:28:13+00:00 2026-05-20T13:28:13+00:00

I am building an invoice system for a client and would like to give

  • 0

I am building an invoice system for a client and would like to give them the ability to change the order status and payment status of the order by selecting them from a select dropdown.

The forms

    <form action="changestatus.php" method="post">
    <input type="hidden" name="status" value="order"/>
    <input type="hidden" name="orderid" value="33"/>
    <select name="orderstatus">
        <option value="Complete">Complete</option>
        <option value="Incomplete">Incomplete</option>
    </select>
    </form>
    <form action="changestatus.php" method="post">
    <input type="hidden" name="status" value="payment"/>
    <input type="hidden" name="orderid" value="33"/>
    <select name="paymentstatus">
        <option value="Complete">Complete</option>
        <option value="Incomplete">Incomplete</option>
    </select>
    </form>

changestatus.php

<?php
switch($_POST['status'])
{
case"payment":  
        mysql_query("UPDATE orders SET payment_status = '$_POST[paymentstatus]' WHERE ID = '$_POST[orderid]'")or die(mysql_error());
break;
case"order":    
        mysql_query("UPDATE orders SET order_status = '$_POST[orderstatus]' WHERE ID = '$_POST[orderid]'")or die(mysql_error());
break;
}

?>

I think I can use jquery.post() (http://api.jquery.com/jQuery.post/) but I have no idea how to implement it.

/////EDIT

OK i found a solution to this.

I changed “changestatus.php” to accept GET variables

   <?php
include"../inc/config.php";
switch($_GET['status'])
{
case"payment":  
        $query = mysql_query("UPDATE orders SET payment_status = '$_GET[paymentstatus]' WHERE ID = '$_GET[ID]'")or die(mysql_error());
        if($query){echo"Saved";}else{echo"Not Saved";};
break;
case"order":    
        $query = mysql_query("UPDATE orders SET orderStatus = '$_GET[orderstatus]' wHERE ID = '$_GET[ID]'")or die(mysql_error());
        if($query){echo"Saved";}else{echo"Not Saved";};
break;
}

?>

Then changed the forms to

    <select name="orderstatus">
        <option value="Complete">Complete</option>
        <option value="Incomplete">Incomplete</option>
    </select>


    <select name="paymentstatus">
        <option value="Complete">Complete</option>
        <option value="Incomplete">Incomplete</option>
    </select>

and finally the javascript

<script>
$(document).ready(function() {


$('#paymentstatus').change(function() {
    url = "changestatus.php?ID=<?php echo $_GET['ORDERID'];?>&status=payment&paymentstatus="+$('#paymentstatus').val();
  $("#payment_status_result").load(url)
});
$('#orderstatus').change(function() {
    url = "changestatus.php?ID=<?php echo $_GET['ORDERID'];?>&status=order&orderstatus="+$('#orderstatus').val();
  $("#order_status_result").load(url)
});
});
</script>
  • 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-20T13:28:13+00:00Added an answer on May 20, 2026 at 1:28 pm

    See http://api.jquery.com/change/ to find out how to trigger javascript when a drop-down menu is changed.

    As for the jquery post, the primary reason for using this is for making an AJAX call. Whatever you do, you don’t want to ever ignore the result. Your script should always return an error or success message.

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

Sidebar

Related Questions

I am building an order system for a client and would like to give
I am building an invoice application. When the user selects the client, then the
I am building a Windows form application using .NET 3.5. I would like to
My situation as follow: I'm building up an invoice system, I have almost everything
I am building an invoice system, where I will use jQuery, to update fields.
Building a website. When I order my tags like this, LightCycle works but Lightbox
building upon the $.fn.serializeObject() function from this question , i'd like to be able
Building a proof-of-concept web site for a group project. Regarding usernames we would like
Building on from a previous query regarding Class::Struct vs Object::Accessor, I'd like to find
So lately I've been thinking of building and implementing my own invoice system with

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.