...

View Full Version : two message Box in prompt



zaman1111
09-23-2005, 03:57 PM
Hi,
Is there anyway i can have a java script one prompt but it will have two message box and two messages. SOmething like asking the user to put userid and password in one prompt instead of two.
Thanks.

zaman1111
09-23-2005, 05:01 PM
Any one have any idea!

TheShaner
09-23-2005, 05:02 PM
As far as I know, JavaScript's Prompt can only accept one string. There's no way of having two input fields in one prompt using JavaScript. However, if you're looking to process a Username and Password, you'd be better off using an HTML Form or putting your webpage in a password protected area of your server if you have that option.

-Shane

zaman1111
09-23-2005, 05:19 PM
thanks for the reply. this is not for user id or pass. I want to insert two DB field from one prompt or any other JS function if available. So I assume JS don't allow me to have two textfields. I wanted to clarify that.

TheShaner
09-23-2005, 05:31 PM
Wait now, this sounds different. Do you want a prompt where this popup asks for two things and then those are inserted into the DB? Or do you want a popup box that DISPLAYS two values from the DB? Because if you're displaying info, then that's easy. You can use a simple Alert box that just displays the values already grabbed from the DB. But if you're inputting info, then JavaScript only allows one field in its Prompt. However, for inputting, you can opt for making Javascript pop-up an HTML page with a form with two input fields that looks like a little pop-up page by disabling the Navigation bar and setting the height and width to a smaller size and such. This may be the effect you want. But then again, not sure exactly what you're looking for.

-Shane

zaman1111
09-23-2005, 05:38 PM
thanks again.
I will be inputing from the prompt to the DB.
Here is the scenerio.
I am checking from a grade selection field if user enters 'WU'; I am asking them to put students last date of attendance and a comment as a prompt. I wanted to display them in one prompt.

TheShaner
09-23-2005, 05:59 PM
Well, if you would like to pop up a window that would input those two fields into the database, you could make a new html page with a form that submits to whatever you're using to access the DB that has those two input fields. Check out the link below on how to create this window. It shows you how to set it up, communicate to it, etc. This may be what you're looking for.

->Here<- (http://www.yourhtmlsource.com/javascript/popupwindows.html)

-Shane

zaman1111
09-23-2005, 06:10 PM
thanks a lot. I might use the pop ups with two times. That might be little easier. Thanks anyway.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum