Required Filed Validator Small Question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I know RFV works(executes) on both Client side and server side.

But if I want to execute only on Client Side due to performance reason then
what I have to do?

Ex: I have a Text box which must be filled. when i Click the Submit button,
immediately Client Side Script shoulb be execute first with out going to
server first.

AM I CLEAR to YOU.....? Please Help Me
 
<msdn>
Validation is performed on the server even if it was already performed on
the client. This allows you to check validation status in server code and
provides security against users bypassing validation.
</msdn>

If you have IE 4+, validations happen on the client-side without any
postback to the server.

Hope that helps.

I know RFV works(executes) on both Client side and server side.

But if I want to execute only on Client Side due to performance reason then
what I have to do?

Ex: I have a Text box which must be filled. when i Click the Submit button,
immediately Client Side Script shoulb be execute first with out going to
server first.

AM I CLEAR to YOU.....? Please Help Me
 
What you could do is to use good, old-fashioned client-side javascript -
say, adding something on the onClick handler. You have to add this
programmatically by adding it to the Controls, Attributes
 
Suppose I want to confirm from user before Delete a Record. When the user
clicks on Delete button, it should raise Confirmation message box immediatly
without going to Server. How can we do that?


My Problem :

I used <asp:buton.....> control with Refquired field validator. When user
clicks on Delete button , he/she must fill 2 fileds before delete that
record. When it was filed then only the confirmation shold raise.

When i working Locally everthing wols fine. When i deploy it on server i
am facing the prbolem which is explained below
its checking the required fileds validation. When user enter those
required values then only the form is submitting(Deleting the Record from
datrabase). But its not raising any confirmation.
I want to know the reason?

I hope I am clear this time,

Thanks for you help
 
In the page load: Button.Attributes.Add ("onClick", "return
confirm('Delete?');");


Suppose I want to confirm from user before Delete a Record. When the user
clicks on Delete button, it should raise Confirmation message box immediatly
without going to Server. How can we do that?


My Problem :

I used <asp:buton.....> control with Refquired field validator. When user
clicks on Delete button , he/she must fill 2 fileds before delete that
record. When it was filed then only the confirmation shold raise.

When i working Locally everthing wols fine. When i deploy it on server i
am facing the prbolem which is explained below
its checking the required fileds validation. When user enter those
required values then only the form is submitting(Deleting the Record from
datrabase). But its not raising any confirmation.
I want to know the reason?

I hope I am clear this time,

Thanks for you help
 
btnDelete.Attributes("onclick")="return confirm(""Are you really really
sure?"");"

Or something alone these lines
 
VIJAY KUMAR said:
I know RFV works(executes) on both Client side and server side.

But if I want to execute only on Client Side due to performance reason then
what I have to do?

Ex: I have a Text box which must be filled. when i Click the Submit button,
immediately Client Side Script shoulb be execute first with out going to
server first.

AM I CLEAR to YOU.....? Please Help Me

I am not 100% sure but I think if you leave out the If page.isvalid Then
..... The server-side validation is not processed.....but I could be wrong :)
 
Back
Top