Jump to content
xisto Community
Sign in to follow this  
humphrey88

Form Prompt

Recommended Posts

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?"

Share this post


Link to post
Share on other sites

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?"

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:
onclick="confirm()"

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.

vujsa

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.