Click to See Complete Forum and Search --> : alert window text help needed


Corngopher
11-19-2004, 02:28 PM
I am attempting to make an alert popup box with user entered text and a static text. "Welcome to the site" would show on the popup box each time with the user text that they input, such as "Corngopher". I have the user part and the alert done but cant get the static text to appear. Heres what I have...

<form name="frmLogin" onsubmit="alert(document.frmLogin.txtUsername.value)">
Username <input type="text" name="txtUsername" size="12" /><br />
<input type="submit" value="Send" />

It has a little place to type your name and a Send button. When I click send, I get whatever the person typed in the box. I just need to get "Welcome to the site" and a single space to show before the user text shows on the pop up box.

Hope it made sense :) and thanks for any help.

NogDog
11-19-2004, 03:22 PM
Do you mean:

<form name="frmLogin" onsubmit="alert('Welcome to the site, ' + document.frmLogin.txtUsername.value + '.');">

Charles
11-19-2004, 03:40 PM
Or perhaps:

<form onsubmit="alert('Welcome to the site, ' + this.txtUsername.value + '.')">

Corngopher
11-19-2004, 05:10 PM
Thank you very much :) worked like a charm and its simplicity makes me feel kinda ... not so on the ball :)

Thank You