SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Wizard
    Join Date
    Apr 2004
    Location
    dublin
    Posts
    2,036
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Using Javascript within PHP

    Hi all,

    How do I get this to work in PHP?
    My problem is the commas in the alert part

    echo '<input type="submit" onclick="alert('Are you sure?')" value="Submit" name="submit2">';

    Thanks.

    Kevin.

  2. #2
    Sell crazy someplace else markl999's Avatar
    Join Date
    Aug 2003
    Location
    Manchester, UK
    Posts
    4,007
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    echo '<input type="submit" onclick="alert(\'Are you sure?\')" value="Submit" name="submit2">';

  3. #3
    SitePoint Addict liquidautumn's Avatar
    Join Date
    Nov 2002
    Location
    Kharkov, Ukraine
    Posts
    210
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    echo '<input type="submit" onclick="alert(\'Are you sure?\')" value="Submit" name="submit2">';
    but you'd better read manuals, before asking such questions

  4. #4
    SitePoint Addict
    Join Date
    Feb 2004
    Location
    Netherlands
    Posts
    381
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    an alert won't work, since it only alerts, you need a confirm! it's a function, try that instead of alert()


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
  •