HOME       >>       Programming

Form Prompt


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 inIf realtor("ID")=1 ThenResponse.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?"


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'>")
End If


Something like onsubmit="Are You Sure?"

Well, I know how to do this in JavaScript which is pretty straight forward.

Somewhere in the head of the document add:
<script language="JavaScript"><!--function confirm(){ window.alert("Are you sure you want to do this?");}// --></script>

Then in you submit button tag add:

That will pop up a little box asking the question you want.

For any other method of performing the same task, I don't know a better way. This is exactly the kind of thing JavaScript was designed for origially. There are more elaborate JavaScript techniques availible but require more line of code.

As far as a server side script, you would have to place it between the form and the main script. Basically submit the form contents to the confirmation script. The confirmation script builds a new form with all of the values from the first form PLUS the confirmation question. The confirmation form then passes the content from the first form to the second script. The second script is the one you already have it looks like.

I'm not an ASP guy so I can't give you the specifics for your situation.

Hope This Helps.



Xisto.com offers Free Web Hosting to its Members for their participation in this Community. We moderate all content posted here but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2001-2019 by Xisto Corporation. All Rights Reserved.