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

Validation and popup window question

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?
Feb 27 '08 #1
3 2012
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?
Feb 27 '08 #2
On Feb 27, 11:29*am, bruce barker
<brucebar...@discussions.microsoft.comwrote:
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, whichis
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?
Feb 27 '08 #3
On Feb 27, 12:07*pm, JJ297 <nc...@yahoo.comwrote:
On Feb 27, 11:29*am, bruce barker

<brucebar...@discussions.microsoft.comwrote:
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?
Feb 27 '08 #4

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

Similar topics

12
by: HarveyB | last post by:
I would like to generate non-modal popup windows from ASP.Net code-behind. I have tried using Client Side scripting like "function Test(){ window.open('test.htm',_blank,...
3
by: Dan | last post by:
First, I'm sorry if this question has been asked too many times. I'm new to this news group. The question has to do with the use of popup windows in a web page. I have heard that popup windows...
7
by: E Michael Brandt | last post by:
I have been lurking here for some time, and now would like to ask a question of you clever coders: My JustSo PictureWindow 3 Extension for Dreamweaver has stumbled in the face of the new Opera...
4
by: Davey | last post by:
I have a website which has a popup window (this only opens when the user chooses to open it). In the popup window I have a <select> control which lists a selection of "classes". Each class has a...
3
by: Earl Teigrob | last post by:
Can a Modal Dialog Box do forms ASP.NET forms validation from within the Modal Box? I want to pop up a dialog box to the user and have it do its own post backs with validation checking and then...
1
by: Matt Jensen | last post by:
Howdy I've got a ASP.NET webform page that pops up a window for a user to make a selection. Once they make a selection in this popup window, the form in the popup is submitted an update to the...
4
by: vickeybird | last post by:
I want to know if it is possible to detect if Pop up Blocker is enabled without trying to open a Pop Up windows. I'm trying to create a web analytics script and visible Pop up in case of disabled...
3
by: mark4asp | last post by:
How can I stop my Calendar control from firing the form validation events? I have a form containing several controls which have several validation controls each. One control is a TextBox...
4
by: Ronald Raygun | last post by:
I have a form on an HTML page with the usual user name, email etc. I want to be able to display a popup window (callout?) when a text input control element is clicked. For example, for the form:...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...

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.