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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:18:28+00:00 2026-06-11T19:18:28+00:00

Sorry to post a question which has already been posted, however I am really

  • 0

Sorry to post a question which has already been posted, however I am really struggling to get this functionality to work. When I change a select box option value I want it to remain the same on page refresh or logout. Must I use AJAX/PHP to get this to work? I have tried to do this to no avail. Possible to run DB update function when dropdown is selected.

My code looks like:

echo '<tr>';
    echo '<td><input type="text" name="order_no[]" value="' . $row['Orderno'] . '"/></td>';
    echo '<td><input type="text" name="order_date[]" value="' . $row['Orderdate'] . '"/></td>';
    echo '<td><input type="text" name="order_ordered_by[]" value="' . $row['Orderedby'] . '"/></td>';
    echo '<td><input type="text" name="order_supplier[]" value="' . $row['Supplier'] . '"/></td>';
    echo '<td><input type="text" name="order_total_price[]" value="' . $row['totalprice'] . '"/></td>';
    echo '<td><input type="text" name="order_requested_by[]" value="' . $row['requestedby'] . '"/></td>';
    echo '<td>';
    echo '<select id ="id" name="id">';
    echo '<option value = "1" class = "pending">Pending</option>';
    echo '<option value = "2" class = "approved">Approved</option>';
    echo '<option value = "3" class ="disapproved">Disapproved</option>';
    echo '</select>';
    echo '</td>';
    echo '</tr>';
  • 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-11T19:18:29+00:00Added an answer on June 11, 2026 at 7:18 pm

    Sounds like the selected status should be an attribute of the order. So you should make an ajax call to PHP (or whatever your server-side language is) to update the status when the selectbox changes. And the selectbox itself should look something like:

    echo '<select id ="id" name="id">';
    echo '<option value = "1" class = "pending"' . ($row['status'] == 'Pending' ? ' selected=selected' : '') . '>Pending</option>';
    echo '<option value = "2" class = "approved"' . ($row['status'] == 'Approved' ? ' selected=selected' : '') . '>Approved</option>';
    echo '<option value = "3" class ="disapproved"' . ($row['status'] == 'Disapproved' ? ' selected=selected' : '') . '>Disapproved</option>';
    echo '</select>';
    

    I don’t think cookies should be necessary

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

Sidebar

Related Questions

Sorry for this long post. The question is however small but requires full detail.
Sorry for the double post, I will update this question if I can't get
Edit: The bug which prompted this question has now been fixed . In the
Thanks in advance, and sorry if this question has been answered previously - I
I am sorry to post question hich was here before, but this is driving
This question is following a previous one which i posted: Django Callback on Facebook
This is probably a stupid question, but I'm really struggling with this concept. I'm
I am really sorry if this is not the right place to post this
First of all, sorry to post a question like this when so many other
I'm sorry to post another question on this, but I just seem to be

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.