Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi.

 

I have a field in my form that I want to check if its content already exsits in my database. Im using a custom validation control for this.

 

I have a function that returns true or false (Custom_Ver). And I have made a sub like this:

Sub Field_Ver(source As Object, args As ServerValidateEventArgs)
If MyFunction() Then
args.IsValid = False
Else
args.IsValid =True
End If
End Sub

 

1. When I have set the Client Validation Function to my Field_Ver function. The brower always fires the validation when ever I enter some thing in the text box. And returns that the content of the textbox is not valid. But this always happens. What ever I enter it fires. I have put in a Response.Write that displays what my function ( Custom_Ver ) returns and it returns false but still the validation control fires. Why?

 

2. If I have set the OnServervalidation to my Custom_Ver function, it wont fire if I have code in that runs when I push my send button.

 

If I leave that sub that gonna run when I click on send, then the validation control works. Promts when the value exsist and not promting when the value does not exsist. But if I have code in my sub that gonna run when I push the button, then the validator does not work. It just fires the click sub and doesn't check the value in the text box. Why is that? The click sub updates stuff in my database by the way.

 

Can someone help me with one of the two probs or both???

 

//Andi

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...