Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

HTML fun

  • 06-05-2004 02: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,173 ✭✭✭✭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,211 ✭✭✭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