I'm pretty much new to jquery. I've been trying to do validations where i check if a textbox length is greater than 4.
So, this is what i did:
$(document).ready(function () {
$('#tbstreet1').blur(isValid);
});
function isValid()
{
Boolean isvalid;
var street1Length = $("#tbstreet1").val().length;
alert(street1Length);
if(myLength >4)
{
isvalid= true;
ActivateSave()
}
}
function ActivateSave()
{
$("#btn_save").attr("Enabled",true);
}
This is my aspx page:
<asp:Label runat="server" ID="street1" Text="Street1" O></asp:Label>
<asp:TextBox ID="tbstreet1" runat="server" CausesValidation="true" ></asp:TextBox>
<asp:Button ID="btn_save" runat="server" Text="Save" Enabled="false" />
I even have script source in my .net page
<script src="http://code.jquery.com/jquery-1.6.4.js" type="text/javascript" >
</script>
But the thing has been that how do i call the javascript function from here? as i 'm pretty sure that my javascript is not getting called. Can u help me?