Hi!
I am having a problem trying to pass a hidden varibale (php generated) into a javasrcipt event (self.location)shown below.
the values dd3.php?cat=val&appid=appidcheck do show up in the url
eg:
localhost/dd3.php?cat=1&appid=8 appears in the url but the values: cat=1 and appid=8 are not submitted into the actionpage (dd3.php).
my guess is that problem originates from:
"self.location="
is there any javascript which allows the action page to accept the passed variables contained in the url?
many thanks in advance
<SCRIPT language=JavaScript>
function reload(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
self.location='dd3.php?cat=' + val +'&appid=' + <?php echo $appidcheck;?> ;
}
function reload3(form)
{
var val=form.cat.options[form.cat.options.selectedIndex].value;
var val2=form.subcat.options[form.subcat.options.selectedIndex].value;
self.location='dd3.php?cat=' + val + '&cat3=' + val2 +'&appid=' + <?php echo $appidcheck;?> ;
}
</script>
////////// Starting of first drop downlist /////////
echo "<select name='cat' onchange=\"reload(this.form)\"><option value=''>Select Exam body</option>";
while($noticia2 = mysql_fetch_array($quer2)) {
if($noticia2['BODYID']==@$cat){
echo "<option selected value='$noticia2[BODYID]'>$noticia2[ORGNAME]</option>"."<BR>";}
else{
echo "<option value='$noticia2[BODYID]'>$noticia2[ORGNAME]</option>"; }
}
echo " <input type='hidden' name='appid' id='appid' value='".$appidcheck."'>";
echo "</select>";
////////////////// This will end the first drop down list ///////////
////////// Starting of second drop downlist /////////
echo "<select name='subcat' onchange=\"reload3(this.form)\"><option value=''>Select caterogry</option>";
while($noticia = mysql_fetch_array($quer)) {
if($noticia['PROGRAMID']==@$cat3){echo "<option selected value='$noticia[PROGRAMID]'>$noticia[TITLE]</option>"."<BR>";}
else{echo "<option value='$noticia[PROGRAMID]'>$noticia[TITLE]</option>";}
}
echo " <input type='hidden' name='appid' id='appid' value='".$appidcheck."'>";
echo "</select>";
////////////////// This will end the second drop down list ///////////
////////// Starting of third drop downlist /////////
echo "<select name='subcat3' > <option value=''>Select Course</option>";
while($noticia = mysql_fetch_array($quer3)) {
echo "<option value='$noticia[TITLE]'>$noticia[TITLE]</option>";
}
echo " <input type='hidden' name='appid' id='appid' value='".$appidcheck."'>";
echo "</select>";
////////////////// This will end the third drop down list ///////////
//
?>