473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Javascript and validation

M
Hi,
it's possible to append a custom action
to a client-side verification of a validation control ?
I have a validator summary control that shows
(automatically) a message box if the validation
of the validators in the page fails; after the user close this
message box I have to perform a client-side function
(hiding some text) ... it's possible?

Thanks!

M
Nov 19 '05 #1
5 2397
Sure!

Google this:
http://www.google.co.uk/search?hl=en...+asp.net&meta=

Let me know if you need anyhelp.

Dan.

"M@" <no*@sorry.com> wrote in message
news:2u********************@twister2.libero.it...
Hi,
it's possible to append a custom action
to a client-side verification of a validation control ?
I have a validator summary control that shows
(automatically) a message box if the validation
of the validators in the page fails; after the user close this
message box I have to perform a client-side function
(hiding some text) ... it's possible?

Thanks!

M

Nov 19 '05 #2
The Microsoft Validation framework does not offer any hooks where you can
take a post-validation action. You will have to invent a hack.

Alternatively, you can switch to "Professional Validation And More"
(http://www.peterblum.com/vam/home.aspx). It is a replacement to Microsoft's
validators that overcomes numerous limitations and addresses the many
features users have asked for with validation.
For example:
1. Every validator has a new property called the Enabler where you establish
a rule that determines if the validator shows or not. This may apply to your
problem.
2. It supports a concept called "validation groups". This allows multiple
submit buttons on the page to fire only their own validators.
3. It has a hook that is called after validation is performed. You insert
your javascript and attach it to the hook.
4. It includes a control called the FieldStateController. Its job is to
monitor clicks on controls and change the settings of other controls. It can
show and hide fields easily.
All of this is multibrowser compatible, supporting far more browsers than
Microsoft's do. (Microsoft's is limited to DHTML browsers: IE and IE/Mac).

Download a free trial version to investigate further and drop me an email if
you have any questions.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlum.com
Creator of "Professional Validation And More" at
http://www.peterblum.com/vam/home.aspx

"M@" <no*@sorry.com> wrote in message
news:2u********************@twister2.libero.it...
Hi,
it's possible to append a custom action
to a client-side verification of a validation control ?
I have a validator summary control that shows
(automatically) a message box if the validation
of the validators in the page fails; after the user close this
message box I have to perform a client-side function
(hiding some text) ... it's possible?

Thanks!

M

Nov 19 '05 #3
The Microsoft Validation framework does not offer any hooks where you can
take a post-validation action. You will have to invent a hack.


While the .Net framework does not do anything after validation, it's not
difficult to create a client side javascript function that will throw an
alert when called, and then perform some action on the web page (in this
case, hiding some text) after that.
Nov 19 '05 #4
M
> Let me know if you need anyhelp.

Hi,
thanks for yours links, I read them and I found them very very
interesting....
My problem is very simple : if you add a Client-side function
to a button
myButton.attributes["onclick"] = "some_function";
..net render this in this way:
<input type=button ........ onclick="some_function">
but if you have a validator on the page asp.net adds after
some_function the javascript code to validate the page...
I would like this behavior:
first validation occurs
after this some_function is called

Thanks you

M
Nov 19 '05 #5
Perhaps I'm missing something, but why not scrap asp.net validation and call
your javascript client side validator function in your "some_function" code?

Validation in ASP.Net is a client side check on the server side control
values (that is the values of controls at the client before they are passed
back to the server) before a postback occurs, normally as a result of a
postback action (eg. server side button). If you have a client side button
(does not perform a post back) then the validation is not for you, and you
simply need to call your validation from your client side code.

If this doesn't work for you, post your code and we'll see if we can help.
What validation do you want to perform?
Why aren't you wanting to perform a postback with the button click (why's
the button not server side)?

Thanks.

Daniel.
"M@" <no*@sorry.com> wrote in message
news:P9********************@twister1.libero.it...
Let me know if you need anyhelp.


Hi,
thanks for yours links, I read them and I found them very very
interesting....
My problem is very simple : if you add a Client-side function
to a button
myButton.attributes["onclick"] = "some_function";
.net render this in this way:
<input type=button ........ onclick="some_function">
but if you have a validator on the page asp.net adds after
some_function the javascript code to validate the page...
I would like this behavior:
first validation occurs
after this some_function is called

Thanks you

M

Nov 19 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Sue | last post by:
After finishing up my first quarter JavaScript on 12/12/03, I decided to improve character checking on my project. In my project I only had to do very basic validation. Therefore, I only had one...
9
by: tzigone | last post by:
hello, i use asp.net validation controls in my site. i wonder whether usin javascript validation will fasten page load speed? there are currently lots of requiredfieldvalidator now is it better t...
111
by: Retlak | last post by:
The recommended (on dozens of websites) and effective (works in Netscape, MSIE, Mozilla, probably others) way to detect if a browser has Javascript turned off is to put this in the <head>: ...
2
by: GIMME | last post by:
Background ... I've created a web application that allows a user to create an HTML application from IE. The application itself creates an XML representation of a XHTML form. The XHTML...
5
by: Allan M. | last post by:
I have a series of select boxes that must be populated client side, because they interact with each other. The design specification calls for these boxes to be updated without having to make a...
5
by: | last post by:
Hi all, Has anyone been able to write some custom javascript on the onclick event of submit button to do certain things like disable submit button, only submit form once etc. This was a breeze...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
27
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it...
6
by: Peter Afonin | last post by:
Hello, I'm creating an application in ASP.NET 1.1. I need to check whether at least one checkbox in my datagrid has been checked. To do this, I'm using Javascript - I'm adding this code to...
5
by: Peter Afonin | last post by:
Hello, I'm not an expert in Javascript, so I'm seeking an advice. As I mentioned in my previous post, I use Javascript to check whether at least one checkbox in the datagrid has been checked....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.