fareedreg Posted January 14, 2010 Share Posted January 14, 2010 I am filling up option with the help of AJAX and php.. No is there any way possible i can select its value at runtime;.. I mean to say that suppose i have supp id 101,102,103 and so on ... user select one of them by himself.... but can i change their values at run time. <select name="cmbsuppid" id="cmbissueid" onchange="showSupplier(this.value)";> <?php include('connect.php'); $Tb = "booksupp_master"; mysql_select_db($Db, $link); $query = "select supp_id from $Tb order by supp_id"; $result= mysql_query($query,$link); $fel=mysql_num_fields($result); $nro=mysql_num_rows($result); if ($nro>0) { while ($row=mysql_fetch_array($result)) { echo "<option value='$row[supp_id]'>$row[supp_id]</option>\n"; } } mysql_close($link); ?> </select> </tr> Link to comment https://forums.phpfreaks.com/topic/188443-select-value-at-run-time/ Share on other sites More sharing options...
Buddski Posted January 14, 2010 Share Posted January 14, 2010 If you are talking about selecting a default item use selected="selected" in the option you want selected.. Im not really sure what you mean by "can i change their values at run time." Link to comment https://forums.phpfreaks.com/topic/188443-select-value-at-run-time/#findComment-994824 Share on other sites More sharing options...
fareedreg Posted January 14, 2010 Author Share Posted January 14, 2010 yes thanks your right .. thats what i need... but suppose i select 102 value its adding one more 102 in list.. i mean doubling of value is visible. I am using echo "<option selected value=$fsuppid>$fsuppid</option>"; If you are talking about selecting a default item use selected="selected" in the option you want selected.. Im not really sure what you mean by "can i change their values at run time." Link to comment https://forums.phpfreaks.com/topic/188443-select-value-at-run-time/#findComment-994828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.