Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 25th, 2006, 07:10 AM
Authorized User
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to catch the alert messages

Hi all
          I hav to catch the messages displayed in alert boxes using some javascript. Is ther any way to trace if any alert boxes are running in the page?
Wat i am need is, if any alert windows are opened(say confirm boxes, message boxes, prompt windows, alert boxes etc..),the javascript must capture the message displayed in the above boxes. Ideas invited.

Thanks
Rohith



Regards
Rohith
__________________
Regards
Rohith
 
Old October 25th, 2006, 07:25 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Getting the value of a Prompt window isn't hard in javascript something like:

var myString = prompt("Whats the question?","")

myString will then have the value of whatever the user types into the prompt box.

Confirm, message, and alert boxes I don't even know if you can grab the information from the window. (Button clicks you can, but the text, I don't know)

Since the developer has control over what these boxes say, I guess the assumption is that you know what it says when it is displayed. You could write a funtion that would fire when a box is displayed to let you know what box is being displayed, other then that I am not sure how you would do this.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old October 25th, 2006, 07:38 AM
Authorized User
 
Join Date: Oct 2006
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks for ur valuable time. But this is not enough for me. I am creating just a frame work for some others websites. I need to access the messages in the alertboxes displayed on those sites..

Thanks

Regards
Rohith
 
Old October 25th, 2006, 07:41 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You can try googling your problem, but I don't think you are going to have much luck. prompt windows, like I said, are easy to grab the values that are placed into them; all of the other boxes are static (unless you are using some sort of variable to determine the message) and I know of no possible way to read that information via JS or even .NET.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old November 2nd, 2006, 05:46 PM
Registered User
 
Join Date: Jun 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I've a typical requirement. I need to catch the user input thru javascript prompt box (e.g., enter your name : http://www.echoecho.com/javascript4.htm and Click 3rd box from left) and submit the input to the server after performing all kinds of validations. Put it in otherwords, I've a asp.net server button submitting few values (by using asp.net server controls) upon performing required field/custom validation checks. I should be able to open prompt box (and force the user to enter some input other than spaces) to the user once all required field/custom validations are passed and just before final submission to the server. Is there any way to achieve it?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Try...Catch lowell VB.NET 3 July 23rd, 2007 06:35 AM
Try Catch not working?? dparsons ASP.NET 1.0 and 1.1 Professional 3 September 18th, 2006 06:54 PM
Try and Catch? mujju PHP How-To 2 January 20th, 2005 12:27 PM
Displaying CustomValidator Error Messages in alert farhan_iac General .NET 0 August 20th, 2004 12:37 AM
Try... Catch... End Try stu9820 ASP.NET 1.0 and 1.1 Basics 4 April 3rd, 2004 11:05 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.