I have a webform application
In Master Page I have the form
<body class="tile-1-bg">
<form id="form1" runat="server">
and in my page.aspx
<div class="control-group" runat="server" id="divNome">
<label for="txtNome" class="control-label">Nome o Ragione Sociale*</label>
<div class="controls">
<asp:TextBox runat="server" ID="txtNome" class="form-control input-sm" required></asp:TextBox>
</div>
</div>
<asp:Linkbutton runat="server" ID="lnkBtnRegistrati" class="btn btn-default btn-lg btn-block" Text="REGISTRATI" OnClientClick="if(checkForm())return true; else return false;" OnClick="lnkBtnRegistrati_Click"></asp:Linkbutton>
I would like to call a Javascript function that simulate Button submit and return false if some validation goes wrong and shows the errors on form fields.
function checkForm()
{
?
}
How can I do?
