473,322 Members | 1,806 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,322 software developers and data experts.

javascript confirm() and validation

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
Nov 21 '05 #1
5 2071
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
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

Nov 21 '05 #2
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. Justin Gengo" wrote:
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
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


Nov 21 '05 #3
Please see this article for a suggested solution:
http://aspalliance.com/699#Page5

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

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
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. Justin Gengo" wrote:
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
> 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


Nov 21 '05 #4
thank you. this helped too.

"Peter Blum" wrote:
Please see this article for a suggested solution:
http://aspalliance.com/699#Page5

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

"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
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. Justin Gengo" wrote:
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
> 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


Nov 21 '05 #5
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:79**********************************@microsof t.com...
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. Justin Gengo" wrote:
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
"rodchar" <ro*****@discussions.microsoft.com> wrote in message
news:41**********************************@microsof t.com...
> 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


Nov 21 '05 #6

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

Similar topics

3
by: GIMME | last post by:
Is there a way to confirm that a string has valid Javascript syntax? Either a client side or server side solution would be ok. For a client side solution I'd like to confirm that, say : var...
3
by: fig000 | last post by:
Hi, I'm relatively new to Javascript so please bear with me on what might sound like silly questions. This is what I want to do: I'm working in classic asp (I have to for this project). I...
7
by: AnnMarie | last post by:
My JavaScript Form Validation doesn't work at all in Netscape, but it works fine in IE. I made some of the suggested changes which enabled it to work in IE. I couldn't make all the changes...
1
by: Muhammad Abdullah | last post by:
Hi am having some problems with the javascript confirm. i have it working fine on one page and it doesnt even pop up at the other. The code on the working page is, private void...
2
by: Roh | last post by:
Hi, Can we use Javascript and .Net Validation controls on the same page. If yes how? Please provide some examples which will help me a lot....thanks.
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...
2
by: bay_dar | last post by:
Hi, I have an internal ASP.NET application that I'm are using to send e-mails out based on a single milepost or milepost range entered. I'm trying to do two things when a user clicks on the...
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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.