Jump to content

Recommended Posts

I have a form that looks like this:

 

<form  method="get">

Postcode:<input name="Postcode" type="text"><br>
Name:<input name="Name" type="text"><br>
<a href="#" onclick="popup('popUpDiv')">Find Agent</a>
<input name="ID" type="hidden">
<input name="Employee_Name" type="hidden">
<input name="Submit" type="submit">

</form>

 

The pop up Div has a Mysql query thats search for available agents that cover the postcode entered in postcode textarea, at the moment the only way I can get this work is by having another submit button which submits the postcode and to the same page.

 

Is there a way use what is entered in the postcode textarea as a php variable without doing a page submit first??

 

Thanks in advance

 

Tom

 

Link to comment
https://forums.phpfreaks.com/topic/228095-help-php-form-problems/
Share on other sites

The easiest, most straightforward way to do it would be by using jQuery.  Otherwise you have to go through all the hoops of doing all the tedious low-level work yourself.

 

That said, it is a good idea to see exactly how it works under the hood, even if you're not going to go that route.  So, look at jQuery first to see how easy it can be, and then look up a tutorial on Ajax and JSON for the details.

 

Google will provide all of what you need if you search.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.