PDA

View Full Version : Problems with Prompt in IE



webprodigy
07-28-2005, 05:37 PM
Hi ,

I am new to javascript i need some help with this script. When i use this code in mozilla it works fine, but if use it in IE it does not display the whole message it displays only 2 lines and cuts off the rest of the message. Please lemme know if anyone has any clue reg this. I am using IE 6.0


function prompting(){
var tname=prompt("Enter your name"+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd" ,name);
document.write("Hello "+ tname);

}


Thanks...

jscheuer1
07-28-2005, 06:41 PM
That's silly. Apparently IE6 just doesn't allocate enough space for the text you wish displayed. The thinking must go that a prompt is only for a short, to the point message, evocative of the type of input desired. In your case, this would suffice:


function prompting(){
var tname=prompt("Enter your name" ,name);
document.write("Hello "+ tname);
}

webprodigy
07-28-2005, 08:19 PM
Thanks for the reply.

I just mentioned "aaaaaaaaaaaaaadddddddddd" just hypothetically. At work we are trying to display a message which is about 3 lines and third line is being truncated in the display. So as i understand there is no way we can do this in IE ??? Please let me know.. If there is no way then i have to come up with an alternative to suffice that.

Thanks.

jscheuer1
07-28-2005, 08:56 PM
As far as I can tell there is no way. The alert & the confirm boxes of IE allow for much more text, perhaps you could have the prompt preceded by an alert or followed by a confirm. Also, I'm pretty good a cutting down on language and still retaining the meaning. I'll take a crack at it if you post your prompt string.

webprodigy
07-28-2005, 09:37 PM
Thanks for your input...

The following is the string which we are using

prompt("Date is incorrect! Date format should be MM/DD/YY or MM/DD/YYYY Example: 01/12/2003; Error code = " + err +"\nCorrect date, click OK; Cancel will empty input", DateValue)

jscheuer1
07-28-2005, 09:58 PM
Give this one a try:
prompt("Date format incorrect! \x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Use \x20MM/DD/YY \x20or \x20MM/DD/YYYY\nExample: 01/12/2003; \x20\x20\x20\x20Correct date, click OK; \x20\x20\x20\x20Cancel will empty input.", DateValue)I really don't think you need that error code thing, looks official enough this way. The \x20 things are added spaces for a more dramatic effect.

bubba.daniel
07-28-2005, 11:03 PM
WOW, John that is cool... It works so much better.

webprodigy
07-29-2005, 02:58 PM
Thanks John,

It really looks alot better..

Crunching the messages is really a art.

Thanks for the help.

snino
07-31-2005, 02:22 PM
IE and JavaScript...ouch...