April 14th, 2003, 12:03 PM
i got this in my code and it prompts the user to enter their name.
prompt('What is your name?','name');
1) how i can put a message in the dialog box's title bar
3) how can i make it so the cancel button when clicked will send you to a specific html
thanx in advance
April 14th, 2003, 04:19 PM
var HTML = '', username = null, start;
username = prompt('What is your name?','name');
if (username != null)
HTML += '<span id="hello" style="left:-200px;font-size:2px;">Hi '+ username+ ' ! Welcome to our Homepage!</span>';
else location = url;
April 14th, 2003, 04:26 PM
3) When the user clicks Cancel, prompt() returns null. So if you assign a var to prompt() ie:
var result = prompt('What is your name?','name');
check for null in result, and then direct the user to the appropriate page.
Edit: I didn't mean to repeat what mrrichardfeder wrote, but rather than delete this post, I thought it might help to leave it.
Last edited by Cira9999; April 14th, 2003 at 04:29 PM.