Hi how does one intantiate a javascript function to do form field validation without a PostBack? But yet keep the postBack to process the form fields.
This is what i have/am doing:
<<PAGE BEHIND>>
protected void Page_Load(object sender, EventArgs e)
{
....
savePersonalInfo.Attributes.Add("onclick", "return validateData()");
....
}
protected void saveInfo_Clicked(object sender, ImageClickEventArgs e)
{
//do something with the form values after passed JS validation
}
<<HTML>>
<script>
function validateData() {.....
</script>
<asp:ImageButton ID="savePersonalInfo" runat="server" ImageUrl="/images/saveBtn.gif" OnClick="saveInfo_Clicked" />
This is what i have/am doing:
<<PAGE BEHIND>>
protected void Page_Load(object sender, EventArgs e)
{
....
savePersonalInfo.Attributes.Add("onclick", "return validateData()");
....
}
protected void saveInfo_Clicked(object sender, ImageClickEventArgs e)
{
//do something with the form values after passed JS validation
}
<<HTML>>
<script>
function validateData() {.....
</script>
<asp:ImageButton ID="savePersonalInfo" runat="server" ImageUrl="/images/saveBtn.gif" OnClick="saveInfo_Clicked" />