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 when there are now issues with the JS form field validation.
This is what i have/am doing:
<<PAGE BEHIND>>
protected void Page_Load(object sender, EventArgs e)
{
....
savePersonalInfo.Attributes.Add("onclick", "return validateData()");
....
}
<<HTML>>
<script>
function validateData() {.....
</script>
<asp:ImageButton ID="savePersonalInfo" runat="server" ImageUrl="/images/saveBtn.gif" OnClick="saveInfo_Clicked" />
What is happening is that the JS is working, it found a null field for first name and alertd the user. But when the "OK" was pressed on the JS alert, the page did a postBack. Han can this be stopped, until all fields pass the JS validation
This is what i have/am doing:
<<PAGE BEHIND>>
protected void Page_Load(object sender, EventArgs e)
{
....
savePersonalInfo.Attributes.Add("onclick", "return validateData()");
....
}
<<HTML>>
<script>
function validateData() {.....
</script>
<asp:ImageButton ID="savePersonalInfo" runat="server" ImageUrl="/images/saveBtn.gif" OnClick="saveInfo_Clicked" />
What is happening is that the JS is working, it found a null field for first name and alertd the user. But when the "OK" was pressed on the JS alert, the page did a postBack. Han can this be stopped, until all fields pass the JS validation