code_junkie

Required Field Validator Not Firing

Nov 12th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. protected void Page_Load(object sender, EventArgs e)
  2. {
  3. Validate();
  4. }
  5.  
  6. ScriptManager.RegisterStartupScript(this, GetType(), "js" + myTextBox.ClientID,
  7. "ValidatorHookupEvent(document.getElementById("" + myTextBox.ClientID +
  8. ""), "onblur", "ValidatorOnChange(event);");", true);
  9.  
  10. function blurred(sender) {
  11. var validator = sender.Validators[0]
  12. validator.evaluationfunction(validator);
  13. }
  14.  
  15. <asp:TextBox runat="server" ID="txt" onBlur="blurred(this)"></asp:TextBox>
Add Comment
Please, Sign In to add comment