Jump to content

Textbox onChange, run PHP


RonnieCosta50
Go to solution Solved by PravinS,

Recommended Posts

I have a textbox.  When the text that is typed into the textbox changes, I want to search my database for what is in the textbox.  I want to do this rather than a search button because my website is really complicated and I'm simplifying it in my explanation to make it easy to understand.  I currently have an alert in my textbox that displays the text that was typed in the textbox on change.  It looks like this.

<input name="txtPlayerName" tabindex="0" style="width: 150px; background-color: #BBAE85;" maxlength="15" required="required" autofocus="autofocus" placeholder="LoU screen name" onchange="alert(this.value)" />

I have a seperate php file called search.php.  It contains my code to search the database based on criteria in my input textboxes.

Question:  How do I tell the textbox to run search.php onChange?

Link to comment
Share on other sites

I don't know any AJAX so that option is out the window.  As for submitting the form to search.php... If I submit a form then it will reload the whole website.  I only want it to search the database and display the data into the website without reloading the website.  There are many textboxes and it would not work to reload the page every time a user switches textboxes. 

Link to comment
Share on other sites

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.