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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

HTML fun

  • 06-05-2004 1:28pm
    #1
    Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭


    Hi I have a link like
    <a href="hj" onclick="return confirm(&quot;are you sure?&quot;);">hhhh</a>
    
    now when I press hhh a box will pop up to say

    are you sure?

    yes/no etc

    if I wanted to have the words
    Are you "Sure"?

    ie with the " included - how do I do this??
    I have tried " and this gives me a JS error
    I have tried \" and ditto

    any ideas??


Comments

  • Registered Users, Registered Users 2 Posts: 68,317 ✭✭✭✭seamus


    try using ' to quote your string instead of "


  • Closed Accounts Posts: 1 moljunior


    change

    <a href="hj" onclick="return confirm("are you sure?";">hhhh</a>


    to

    <a href="hj" onclick="return confirm("are you sure?";">Are you "sure"?</a>

    worked for me


  • Registered Users, Registered Users 2 Posts: 629 ✭✭✭str8_away


    You can use " inside of ' or ' inside of "

    So first thing is to change
    <a href="hj" onclick="return confirm("are you sure?");">hhhh</a>
    to
    <a href="hj" onclick='return confirm("are you sure?");'>hhhh</a>
    or
    <a href="hj" onclick="return confirm('are you sure?');">hhhh</a>

    but since you want to display are you "Sure"
    then you coule use the \" but this need to match the outer

    so your finnal code should be
    <a href="hj" onclick='return confirm("are you \"Sure\"?");'>hhhh</a>


    I hope this is clear :D


  • Registered Users, Registered Users 2 Posts: 3,177 ✭✭✭oneweb


    You have th bracket and semicolons in the wrong places too. Why not use *SURE*?, it's punctuationally more correct (tho I'm not sure that word is grammatically correct :p)

    Try
    </head><body><a href="hj" onclick='confirm("are you \"sure?\"");'>hhhh</a></body></html>
    

    ok so str8 spotted it already :)

    It is what it's.



  • Registered Users, Registered Users 2 Posts: 322 ✭✭Kobie


    Have you written a confirm() function that returns true or false?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 6,240 ✭✭✭hussey


    Thanks str8away

    Ps I only used that code as an example, so grammer isn't an issue


    just one thing

    I actually used return confirm(&quot; ) rather than return confirm("


  • Closed Accounts Posts: 358 ✭✭CH


    shouldn't this thread be under Webmaster / Flash


Advertisement