Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Tricky Javscript problem...

Options
  • 04-10-2007 4:52pm
    #1
    Closed Accounts Posts: 336 ✭✭


    Hi All

    Ok. i have a javascript confirm in one of my JSPs which gets its message from a resource bundle in a properties file.

    <input type="submit"
    onclick="return confirm('<fmt:message key="Exit.UND"/>')" tabindex="9989"
    accesskey="E"
    id="btn_close_0"
    name="btn_close_0"
    value="Exit "
    class="btn"/>

    The message property is as follows:

    Exit.UND=If you exit now, some information may not be saved. This only affects data you’ve just entered on the current screen. To save the data,<em> return <em>and press "Next"

    So far so good.

    Problem arises when i need to add more info to this message - and skip a line before the next sentence begins.

    I have tried:

    <br>
    <br/>
    \n
    <br>
    <br/>

    I am perplexed.. any javascript gurus able to tell me how to edit the resource message so that i get the desired effect in my dialog box?

    Thanks..

    Gav


Comments

  • Registered Users Posts: 413 ✭✭ianhobo


    hey,

    i havent used message boxes in a while,
    if i remember correctly, they dont take html, so the <br /> etc wont work

    I think your on track with the \n, however, \n just moves to a new line, directly below where you finished, but the same amount of columns acorss.

    Try using \n with \r for a carriage return to reset to the beginning of the line

    "....my message text \r\n new line of text...."


  • Closed Accounts Posts: 336 ✭✭geuro


    thanks mate.. your suggestion is the way to do it when one adds the confirmation text directly into the javascript itself.

    But in my example i want to add the character return in the properties file; and sadly, a \r\n, \n, '\r\n&apos etc ... doesn't work :confused:


  • Closed Accounts Posts: 85 ✭✭brendanuk


    Have you tried escapeing the \ slash i.e \\n or \\r


Advertisement