0
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">

<script language="javascript" type="text/javascript">
function run(){
    
if (document.txtbox.value.length==0){
    alert("BLANK");
   }
}

</script>

<form name="test" action="javascript<b></b>:void()"  method="get">
<input type ="text" name="txtbox" value="" />
<input type ="button" name="btn" value="CLICK" onclick="run()" />
</form>
 
</asp:Content>

I'm using masterpage and the above code is on dafault.aspx, I wanted to place some JS on aspx page. However i encounter error state that

Message: 'document.txtbox.value' is null or not an object

Why is tat so?

1
Contributor
0
Replies
1
Views
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.