I am using a javafunction (onclick in select) in which i am calling a
function in php (thats why i send this to both php and javascript
newsgroups).
in the onclick i call the function "Place_Selected " with the value from the
select (naam_keuze.val ue)
in the function the value becomes the $zoek_id and searches in the database
for the record with the id of $zoek_id
the naam_keuze.valu e does not give the value to $zoek_id
When i replace naam_keuze.valu e for a number (15) i works great.
WHAT AM I DOING WRONG?
This is my code
Function Place_Selected( $zoek_id)
{
include("data.p hp");
$link=mysql_con nect($db_host, $username, $password) or die("Database
error!");
mysql_select_db ($database , $link)or die("Couldn't open $db:
".mysql_error() );
$sql=mysql_quer y("SELECT * FROM specialismen WHERE id='$zoek_id'") ;
if ($sql)
{
while($blah2 = mysql_fetch_arr ay($sql))
{
$newsid = $blah2['id'];
$sticky = $blah2['naam'];
}
}
return("documen t.form.achterna am.value='$stic ky'");
}
<select id=naam_keuze size=1 name=keuze style=visibilit y:hidden
onchange=".Plac e_Selected('naa m_keuze.value') .";document.for m.voornaam.valu e
=naam_keuze.val ue;>
<option value=0>Kies
$options
</select>
Thanks for suggestions
roy
function in php (thats why i send this to both php and javascript
newsgroups).
in the onclick i call the function "Place_Selected " with the value from the
select (naam_keuze.val ue)
in the function the value becomes the $zoek_id and searches in the database
for the record with the id of $zoek_id
the naam_keuze.valu e does not give the value to $zoek_id
When i replace naam_keuze.valu e for a number (15) i works great.
WHAT AM I DOING WRONG?
This is my code
Function Place_Selected( $zoek_id)
{
include("data.p hp");
$link=mysql_con nect($db_host, $username, $password) or die("Database
error!");
mysql_select_db ($database , $link)or die("Couldn't open $db:
".mysql_error() );
$sql=mysql_quer y("SELECT * FROM specialismen WHERE id='$zoek_id'") ;
if ($sql)
{
while($blah2 = mysql_fetch_arr ay($sql))
{
$newsid = $blah2['id'];
$sticky = $blah2['naam'];
}
}
return("documen t.form.achterna am.value='$stic ky'");
}
<select id=naam_keuze size=1 name=keuze style=visibilit y:hidden
onchange=".Plac e_Selected('naa m_keuze.value') .";document.for m.voornaam.valu e
=naam_keuze.val ue;>
<option value=0>Kies
$options
</select>
Thanks for suggestions
roy
Comment