Jump to content

Disable text input


roeyhaim

Recommended Posts

hello

my code is this:

<script type="text/javascript" src="jquery-1.2.1.pack.js"></script>
<script type="text/javascript">
function lookup(inputString) {
	if(inputString.length == 0) {
		// Hide the suggestion box.
		$('#suggestions').hide();
	} else {
		$.post("rpc.php", {queryString: ""+inputString+""}, function(data){
			if(data.length >0) {
				$('#suggestions').show();
				$('#autoSuggestionsList').html(data);
			}
		});
	}
} // lookup

function fill(thisValue) {
	$('#inputString').val(thisValue);
	setTimeout("$('#suggestions').hide();", 2000);
        document.form1.inputString.disabled=true;
}
</script>

 

as you can see i try to Disabled the text input after the fill done,

but when i try this it Disabled the text input before i get to choose from my list

(this code is for auto-suggest in form)

 

this is the link to the script:

<input type="text" size="30" value="" id="inputString" onkeyup="lookup(this.value);" onblur="fill();" name="inputString" />

 

how i can do this?

Link to comment
https://forums.phpfreaks.com/topic/218457-disable-text-input/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.