Forum Moderators: open
and a warm welcome to these forums. ;)
I have no problem with prompt(); in IE7. :)
birdbrain
The user can change the default, but I can't expect the public to be savvy enough to know how to do that. So I'm looking for an alternative to prompt(). Any suggestions?
Kathy
Barring that, you can do one of two things:
userid=prompt('enter your user id');
if (! userid) {
my_form = '<form method="post" action="some_action">';
my_form +='<input type="text" name="userid">';
my_form += '<\/form>';
document.write(my_form);
}
Or you can use the document write to create a link that points to a small page to tell your users how to enable Javascript prompts.
A word here - don't bother doing a browser ID to produce code only for IE 7. It's convoluted and unnecessary, and will break when the next version comes out, and will also cause users with the prompt enabled in IE7 to get the same output. Your problem is the prompt - it doesn't matter what browser or version it is, if the prompt is not returning the required value, that's all you need to act on.
But as I said, all this falls down if Javascript is disabled.