php - undefined is not a function javascript but works with alert box -
i keep getting error. found giving alert box first line of function got rid of problem. :(. function loop through select list onkeypress search textbox , compare options in select list. if doesn't match temporarily remove or disable them. apologize may have not phrased question right @ first. code:
function search() { var searchtext = document.getelementbyid("usersearch").value; var userslist = document.getelementbyid("users"); userslist.disabled(true); for(var = 1; i<userslist.length; i++) { alert("test"); } } html code:
the problem persists , have looked on internet problem think can caused several reasons. using opera testing.
this code creates select list.
<script type="text/javascript"> var request = $.ajax({ url: "sendmsgprep.php", type: "post", datatype: "html" }); request.done(function(msg) { $(".users").html(msg); }); request.fail(function(jqxhr, textstatus) { //alert( "request failed online 367: " + textstatus ); }); </script> other file 'sendmsgprep.php"
<?php $id = $_cookie['id']; $username = $_cookie['username']; require("connect.html"); echo '<select name="users" id="users" tabindex="4" onfocus="wipe(this)"> <option value="">--select--</option>'; $query = "select * users user_id!='$id'"; $result = mysql_query($query, $connect)or die("error on line 31<br>".mysql_error()); while ($row = mysql_fetch_array($result)) { echo "<option value=".$row['user_id'].">".$row['username']."</option>"; } echo '</select>'; ?>
Comments
Post a Comment