473,785 Members | 2,460 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2418
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.co m> wrote in message
news:2u******** ************@tw ister2.libero.i t...
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 "Profession al 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 FieldStateContr oller. 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****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"M@" <no*@sorry.co m> wrote in message
news:2u******** ************@tw ister2.libero.i t...
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.attrib utes["onclick"] = "some_function" ;
..net render this in this way:
<input type=button ........ onclick="some_f unction">
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_funct ion" 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.co m> wrote in message
news:P9******** ************@tw ister1.libero.i t...
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.attrib utes["onclick"] = "some_function" ;
.net render this in this way:
<input type=button ........ onclick="some_f unction">
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
2693
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 function to verify the name fields, age, email and gender. My question is: if I create a function for each field like the code below, what would be the best way to organize the functions and call them? Would I need one main function and place...
9
4032
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 use 1 javascript instead of these validators tzigon ----------------------------------------------------------------------- Posted via http://www.forum4designers.co -----------------------------------------------------------------------
111
14431
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>: <noscript> <meta http-equiv="refresh" content="1;url=http://yourURL/nojscript.html"> </noscript> This redirects to a doc which typically says "You need to enable
2
1459
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 representation can be saved as a string and recreated. (The application also has a crude workflow aspect - so XMHTML forms can be created and assigned a workflow. Forget I said anything about
5
2137
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 roundtrip to the server. The codebehind seems to be unaware of select box members populated via javascript. So, I'm having to create my own state management solution, (i.e. rewriting the VIEWSTATE mechanism) to persist the state of these select...
5
2647
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 in 1.1 since I could edit the .js file. Now in 2.0 I can no longer do this. Also, my code would have to be called after all client-side validation was done and was successful. Any ideas? TIA!
8
3677
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
27
4758
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 appears that the data goes straight to the processing page, rather than the javascript seeing if data is missing and popping up an alert. I thought it may be because much of the form is populated with data from the db (lists, etc.), but when I leave...
6
3287
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 Page_Load event: Dim iCount As Int32 Dim sClientSideValidate As New StringBuilder iCount = dgReport.Items.Count For i As Int32 = 2 To iCount + 1
5
1915
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. I have to use Stringbuilder to do this: Dim iCount As Int32 Dim sClientSideValidate As New StringBuilder
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.