javascript confirm() and validation

G

Guest

hey all,

in my page load i'm attaching a javascript confirm message to my save
button. my problem is i have some client side validation which uses a Custom
Validator web control and when i make the validation go off and hit save, it
allows me to postback with the error. Am i doing something wrong?

thanks,
rodchar
 
S

S. Justin Gengo

Rodchar,

What do you have the confirm script doing? Does it check validation first?
Does it submit the form itself?

The easiest way to attach a confirm to a button is to run the confirm and
then just return true or false back to the button click. That way if it
returns false it's like the button was never clicked at all.

I have a sample of doing it this way here:
http://www.aboutfortunate.com?page=javascriptdemo


--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
G

Guest

Thanks for the tip. Cool Bio.
I downloaded the vs.net proj on your site. is that something i can use in my
project? if so, would it be hard for a beginner to learn?

thanks,
rodchar
 
S

S. Justin Gengo

Rodchar,

Thanks. The website is actually my first experiment with .Net 2003 using
controls dynamically added to one single default page. Early on I used only
post back buttons to move from one area to the next and then later I
realized that google couldn't see anything but the home page then. So I
changed the site to use the query string to control which control is loaded.

Now .Net 2005 has taken care of all of this for us. I love its master pages.
I'll be re-releasing my site (actually breaking it up into at least three
different sites) eventually.

Yes, you could just reference the entire .dll file from your application and
then use any of the methods the component contains. If you're using Visual
Studio.Net I have a help file you can download (same location as the .dlls)
that goes over each method and also contains a brief how to on referencing
the .dll. If you have any questions feel free to email me.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top