Results 1 to 9 of 9

Thread: Problems with Prompt in IE

  1. #1
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Problems with Prompt in IE

    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...

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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:

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

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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.

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    Last edited by jscheuer1; 07-28-2005 at 09:01 PM.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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)

  6. #6
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Give this one a try:
    Code:
    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  7. #7
    Join Date
    Jul 2005
    Location
    cali
    Posts
    95
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    WOW, John that is cool... It works so much better.

  8. #8
    Join Date
    Jul 2005
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up

    Thanks John,

    It really looks alot better..

    Crunching the messages is really a art.

    Thanks for the help.

  9. #9
    Join Date
    Jul 2005
    Location
    Dont ask
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    IE and JavaScript...ouch...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •