Jump to content

onChange with MySQL variable


Recommended Posts

Hello All,


I have a form that has a DropDown list that is called from an SQL statement; in the SQL table it has a "name" and "email", what I want is the form to grab the "email" as a variable from a "onChange" event so when my form is posted it carries the "email" as a variable that I can use in a function. 


I can add the email as a hidden <input> however since I don't know how to create an onChange event to grab the "email" from the SQL instance when the drop down is selected I can't pass the email as a variable when the form is posted.  I suppose this either needs to be done in Ajax or using JQuery however I'm not sure what is the best approach or way to do it.


Does anyone have any spare time to educate me on this, I've never written Ajax or JQuery code before, trying to do this in php alone does not seem like a solution.


Thank you in advance

Edited by jperez260
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.

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.