1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Simple Form Prompt

Discussion in 'C#' started by clasione, Aug 14, 2006.

  1. #1
    Anyone care to share how I can add a simple promt for asking the user:

    "Are You Sure You Want to do This?" on submit.....

    <%
    'show Remove Expired button if Mike is logged in
    If realtor("ID")=1 Then
    Response.Write("<FORM ACTION='mainmenu.asp' METHOD='post'>")
    Response.Write("<INPUT type='submit' name='S2' value='Remove Expired'>")
    Response.Write("</FORM>")
    End If

    %>

    Something like onsubmit="Are You Sure?"
     
    clasione, Aug 14, 2006 IP
  2. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #2
    add "javascript: return confirm('are you sure...');" to either the onsubmit action of the form, or the onclick of the submit button
     
    frankcow, Aug 14, 2006 IP
  3. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #3
    I can't use the "quotes" since it seems to break the line so I used the apostrophy ' ---- Tryed a few different ways and it didn't work for some reason.... Will wait to find more possible ways.... thanks... ;)
     
    clasione, Aug 14, 2006 IP
  4. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #4
    try this:
    Response.Write("<INPUT type='submit' name='S2' value='Remove Expired' onclick=""javascript: return confirm('are you sure...');"">")
     
    frankcow, Aug 14, 2006 IP
  5. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #5
    Excellent ------- It worked...... Thank you very much! ;)
     
    clasione, Aug 14, 2006 IP
  6. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #6
    you're welcome (green rep points are always appreciated...)
     
    frankcow, Aug 14, 2006 IP
    clasione likes this.
  7. clasione

    clasione Notable Member

    Messages:
    2,362
    Likes Received:
    158
    Best Answers:
    0
    Trophy Points:
    228
    #7
    Green Applied ;)
     
    clasione, Aug 14, 2006 IP
  8. frankcow

    frankcow Well-Known Member

    Messages:
    4,859
    Likes Received:
    265
    Best Answers:
    0
    Trophy Points:
    180
    #8
    thanks! always appreciated
     
    frankcow, Aug 15, 2006 IP