ajax problem in firefox while retrieving <select name='value'> value

AnJi

New Member
dear all,i'm getting this problem with firefox and not with IE.In first combo, i'm getting roles:\[code\]<tr><td>Select Role:</td><td><select name="usrrole" onChange="showuser(this.value)"> <option value=''>Please Select</option><?php $rle = "select * from role_table"; $dorle = mysql_query($rle); while($data = http://stackoverflow.com/questions/3831828/mysql_fetch_array($dorle)){ echo ("<option value=http://stackoverflow.com/questions/3831828/$data[roleid]>$data[rolename]</option>");}?></select></td></tr><tr> <td> Select User </td> <td id="showus"> </td> <!-- this is the div collected from ajax --></tr><tr> <td colspan=2> <input type='submit' name='submit' /> </td></tr>\[/code\](((( AJAX.JS ))))\[code\]function GetXmlHttpObject(){ var xmlHttp=null; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } } return xmlHttp; }function showusrinfo(){if (xmlhttp.readyState==4 || xmlhttp.readyState=="complete") { document.getElementById('showus').innerHTML=xmlhttp.responseText; }}function showuser(str){ xmlhttp=GetXmlHttpObject(); var url="../get.php"; url=url+"?showus="+str; xmlhttp.onreadystatechange=showusrinfo; xmlhttp.open("GET",url,true); xmlhttp.send(null); }\[/code\](((( GET.PHP ))))\[code\]if(isset($_GET["showus"])){$q = $_GET["showus"];$sql = "select uid,username from usertable where roleid='".$q."'";$qry = mysql_query($sql);$num = mysql_num_rows($qry);if($num){ $my = "<select name='touser'>"; $my .= "<option selected value=''>Please Select</option>"; while($result = mysql_fetch_array($qry)){ $my .= "<option value='".$result['uid']."'>$result[username]</option>";}echo $my;} else{ $notmy = "No Record";}echo $notmy;}\[/code\]Now, the problem arises when I Submit it:if i print the variables after submit, then in INTERNET EXPLORER:\[code\]Array( [usrrole] => 1 [touser] => 3 [submit] => submit)\[/code\]and in FIREFOX:\[code\]Array( [usrrole] => 1 [submit] => submit)\[/code\]As you can see, the variable generated in AJAX is only shown in IE and not in FF, therefore, there is an error running the code in FF. I'm a newbie in programming and stuck in it, please help.cheers.
 
Back
Top