Hi,
Im new to this. I have a code written in PHP which pulls info out of a MySql database with a select statement. I would like to add javascript to the HTML select code once its created. The current PHP code looks like this:
<? sysGetSelect(country, dt_countries) ?>
Once the code is generated in the browser, it looks like this:
<select name="country">
<option value="" selected>Select One</option>
<option value="6">Albania</option>
</select>
I just want to add this javascript line in there somehow:
<select name="country" onChange=ChangeDetail(this.form)>
How do I do that??
This won't work:
<? sysGetSelect(country, dt_countries) onChange=ChangeDetail(this.form)?>
What do I do? Im a newbie...
Also, when I use this variable:
$country
A numeric number is displayed for the country instead of the country NAME.
For example, using the info above, 6 would be displayed, instead of Albania.
In the MySql database, for the table dt_countries, I have these fields:
ID and NAME
ID is the numeric part and NAME is the letters.
So how do I call the Name part of the database from my PHP code?
Basically instead of 6, I want to display Alabama.
PLEASEEEE helpppp....... 🙁