Jump to content

onChange with MySQL variable


jperez260

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

Link to comment
https://forums.phpfreaks.com/topic/288203-onchange-with-mysql-variable/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.