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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T09:08:31+00:00 2026-06-13T09:08:31+00:00

I have a website that updates the users location through the use of form

  • 0

I have a website that updates the users location through the use of form elements.

The first thing a user does is click a button labeled Check In. This updates the database ( a php on another page through the use of AJAX). After clicking Check In, the user is presented with a select/dropdown with a list of locations. The user clicks one of the locations on the select, then the php page is updated with the location again. The user can do this many times, with each time updating the database. When the user is done, he scrolls down the select/dropdown to the last option called Check Out. When the user hits checkout, the database is updated once more, and red text appears instead of the select saying “Checked Out”.

Here’s my code (minus the php/database stuff):

<script src="http://code.jquery.com/jquery-1.8.2.js"></script>

<script type="text/javascript">

$(document).ready(function() {
  // Hide the form on load      
  $('.locationSelect').hide();
  // Hide the completed message
  $('.finished').hide();
});

// When someone clicks checkin this function will be called
$('.checkIn').click(function(){
$e = $(this);
 $.ajax({
    type: "POST",
    url: "changeloc.php", // this page adds date to the database
    data: "checkIn="+$(this).val(), // we are sending $_POST['checkIn']
    success: function(){
       // Display the form once AJAX is finished 
       $('#myForm').show();
    }
 });
});

// This function will be called when someone uses the select field
$('.[locationSelect]').change(function(){
  $e = $(this);
  $.ajax({
    type: "POST",
    url: "changeloc.php",
    data: "locationSelect="+$(this).val(),
    success: function(){
       // Display the form once the AJAX is finished 
       alert('Done');
    }
  });
});


</script>

and here is the html:

<button class="checkIn">Check In</button>

<form method='post' class='myForm' action=''>

<td>
<select name='locationSelect' class='locationSelect'>
    <option value='1'>Exam Room 1</option>
    <option value='2'>Exam Room 2</option>
    <option value='3'>Exam Room 3</option>
    <option value='4'>Exam Room 4</option>
    <option value='Check Out'>CheckOut</option>
</select>
</form>


<div class='finished' style='color:#ff0000;'>Checked Out</div>

The problem is that when you hit Check In, the select doesn’t show up. I checked the Chrome Error Console, but no errors came up.

Thanks for all help!

  • 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-13T09:08:32+00:00Added an answer on June 13, 2026 at 9:08 am

    Well, here:

    // Display the form once AJAX is finished 
    $('#myForm').show();
    

    Should be this:

    // Display the form once AJAX is finished 
    $('.myForm').show();
    

    Aside from that, verify that your Ajax query returns properly, otherwise this code is not going to run.

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

Sidebar

Related Questions

I have a website I am making that tracks a users companies through employments.
I have a Section in my website called Recent Updates. in that I will
On my website, I have user accounts that are configurable with forms that allow
I have a website that calculates a users involvement/activity using multiple MySQL queries. For
I have a website that has lots of users that would like to see
I have an Asp.Net 4.0 website/control interface that uses an update panel and some
I have a website that is updated regularly and I am having a problem
I have a website that I regularly update the code to. I keep it
So basically I have website that has names of cities that can be checked
I have a website that is mainly based on JavaScript. It uses a REST

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.