Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Validation and popup window question

Reply
Thread Tools

Validation and popup window question

 
 
JJ297
Guest
Posts: n/a
 
      02-27-2008
After a user clicks the submit button I want a window to come up
telling them your entry has been submitted.

I have this code in my page load section which works well.

Submit.Attributes.Add("onclick", "return window.confirm('Your entry
was submitted.')")

My problem is it's not picking up my validation if the user doesn't
fill in the text boxes and just hit the submit button they get your
entry was submitted. How do I get it to see the validation first and
only submit the page after it's filled out?
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      02-27-2008
the validation call is added to the onclick event also, but comes after your
call (but your return prevents the validation call). you can call the
validation logic yourself, or attach you code to the onsubmit event, which is
only called after validation. (RegisterOnSubmitStatement).

though it seems pretty bush to popup an alert that the user pressed the save
button. confirmation on the response page that it was actually saved seems
better (and not an alert).


-- bruce (sqlwork.com)


"JJ297" wrote:

> After a user clicks the submit button I want a window to come up
> telling them your entry has been submitted.
>
> I have this code in my page load section which works well.
>
> Submit.Attributes.Add("onclick", "return window.confirm('Your entry
> was submitted.')")
>
> My problem is it's not picking up my validation if the user doesn't
> fill in the text boxes and just hit the submit button they get your
> entry was submitted. How do I get it to see the validation first and
> only submit the page after it's filled out?
>

 
Reply With Quote
 
 
 
 
JJ297
Guest
Posts: n/a
 
      02-27-2008
On Feb 27, 11:29*am, bruce barker
<(E-Mail Removed)> wrote:
> the validation call is added to the onclick event also, but comes after your
> call (but your return prevents the validation call). you can call the
> validation logic yourself, or attach you code to the onsubmit event, which is
> only called after validation. (RegisterOnSubmitStatement).
>
> though it seems pretty bush to popup an alert that the user pressed the save
> button. confirmation on the response page that it was actually saved seems
> better (and not an alert).
>
> -- bruce (sqlwork.com)
>
>
>
> "JJ297" wrote:
> > After a user clicks the submit button I want a window to come up
> > telling them your entry has been submitted.

>
> > I have this code in my page load section which works well.

>
> > Submit.Attributes.Add("onclick", "return window.confirm('Your entry
> > was submitted.')")

>
> > My problem is it's not picking up my validation if the user doesn't
> > fill in the text boxes and just hit the submit button they get your
> > entry was submitted. *How do I get it to see the validation first and
> > only submit the page after it's filled out?- Hide quoted text -

>
> - Show quoted text -


I had a label on the page telling the user the page was submitted but
the user insteads wants a pop-up window.

How do I set my page up to use RegisterOnSubmitStatement?
 
Reply With Quote
 
JJ297
Guest
Posts: n/a
 
      02-27-2008
On Feb 27, 12:07*pm, JJ297 <(E-Mail Removed)> wrote:
> On Feb 27, 11:29*am, bruce barker
>
>
>
>
>
> <(E-Mail Removed)> wrote:
> > the validation call is added to the onclick event also, but comes after your
> > call (but your return prevents the validation call). you can call the
> > validation logic yourself, or attach you code to the onsubmit event, which is
> > only called after validation. (RegisterOnSubmitStatement).

>
> > though it seems pretty bush to popup an alert that the user pressed the save
> > button. confirmation on the response page that it was actually saved seems
> > better (and not an alert).

>
> > -- bruce (sqlwork.com)

>
> > "JJ297" wrote:
> > > After a user clicks the submit button I want a window to come up
> > > telling them your entry has been submitted.

>
> > > I have this code in my page load section which works well.

>
> > > Submit.Attributes.Add("onclick", "return window.confirm('Your entry
> > > was submitted.')")

>
> > > My problem is it's not picking up my validation if the user doesn't
> > > fill in the text boxes and just hit the submit button they get your
> > > entry was submitted. *How do I get it to see the validation first and
> > > only submit the page after it's filled out?- Hide quoted text -

>
> > - Show quoted text -

>
> I had a label on the page telling the user the page was submitted but
> the user insteads wants a pop-up window.
>
> How do I set my page up to use RegisterOnSubmitStatement?- Hide quoted text -
>
> - Show quoted text -


I got this to work:

Page.ClientScript.RegisterStartupScript(Me.GetType (), "clientScript",
"window.alert('Your entry was submitted');", True)

How do I add window.location.href to this script to go to another page?
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
popup window close to submit opener window without 'causes validation' happening Matt Jensen ASP .Net 1 12-16-2005 03:16 PM
Popup Window Popup Timing =?Utf-8?B?Sm9obiBXYWxrZXI=?= ASP .Net 3 11-04-2005 07:33 PM
New Popup Window from an existing Popup Window Raffi Javascript 4 08-12-2004 01:21 PM
Main > Popup > Popup > Close popup AND new URL in main? Jens Peter Hansen Javascript 7 06-19-2004 08:56 PM
Click link in popup window and insert link text in a field of mother window BlueŽ Javascript 4 09-27-2003 05:18 PM



Advertisments