You need to sign in to do that
Don't have an account?
Starhunter
Enabling search button after entering two characters in search box
I want the search button to be disabled on load of page. Only after the user has entered two characters should the search button be enabled to click. I want to achieve this using jquery,something I am not used to. I googled a bit and came to the following :
<script>
$(document).ready(function(){
$("#btnDisabled").attr("disabled", true);
}
$('#searchbox').on("keyup", disableaction);
function diableaction()
{
if($("#btnDisabled").val().length>1)
$("#btnDisabled").attr("disabled", false);
}
</script>
Where searchbox is the id of the apex inputtext field and btnDisabled is that of the command button
The button is not even getting disabled on page load.
<script>
$(document).ready(function(){
$("#btnDisabled").attr("disabled", true);
}
$('#searchbox').on("keyup", disableaction);
function diableaction()
{
if($("#btnDisabled").val().length>1)
$("#btnDisabled").attr("disabled", false);
}
</script>
Where searchbox is the id of the apex inputtext field and btnDisabled is that of the command button
The button is not even getting disabled on page load.