Nov 21, 2009

Form Prompt

free web hosting
Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > ASP / ASP.NET

Form Prompt

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

Comment/Reply (w/o sign-up)

vujsa
QUOTE(Humphrey1988 @ Aug 19 2006, 12:45 PM) *

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:
CODE
<script language="JavaScript">
<!--
function confirm(){
     window.alert("Are you sure you want to do this?");
}
// -->
</script>


Then in you submit button tag add:
CODE
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

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : Prompt


    Looking for form, prompt

See Also,

*SIMILAR VIDEOS*
Searching Video's for form, prompt
advertisement



Form Prompt

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com