Welcome Guest ( Log In | Register )



 
Reply to this topicStart new topic
> Form Prompt
Humphrey1988
post Aug 19 2006, 04:45 PM
Post #1


Newbie [ Level 2 ]
Group Icon

Group: Members
Posts: 18
Joined: 19-August 06
Member No.: 15,398



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?"
Go to the top of the page
 
+Quote Post
vujsa
post Aug 19 2006, 08:37 PM
Post #2


Absolute Newbie
Group Icon

Group: Admin
Posts: 888
Joined: 20-February 05
From: Indianapolis, Indiana, USA (Midwest)
Member No.: 2,714



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Code To Send An Email From A Form(10)
  2. Need Help With Javascript Form Validation(2)
  3. Command Prompt Tips(1)
  4. PHP Tutorial: Form Verification And Simple Validation(12)
  5. A Big Hug Form Down Under(0)
  6. Windows 2000 Prompt Authentication(0)
  7. Virtuemart Question(0)
  8. Submiting Form Data To "file.php?action=login"(7)
  9. Advanced Form Question(0)
  10. What's Wrong With This Form?(5)
  11. Bug With Firefox(4)
  12. Storing Data Into Xml With A Php Form(2)
  13. Updating An Rss File Using A Php Form(1)
  14. How To Boot To Command Prompt(12)
  15. Quickly Create Form Variables(5)
  1. "Command Prompt"(5)
  2. Question About An Email Form(4)
  3. Nice Form(9)
  4. Problem With Form Elements(3)
  5. How To Open The Cmd Prompt When Blocked By Admins.(7)
  6. Web Form Generator(5)
  7. Need Help With Form!(8)
  8. Pause A Command Prompt After Execution?(5)
  9. Request Form Site Suspended(4)
  10. Design A Contact Form In Flex Part 1(0)
  11. How To Make Simple Animations In The Gimp(2)
  12. How To Design A Form In Flex 2(0)
  13. How To Design A Contact Form Part 3(0)


 



- Lo-Fi Version Time is now: 13th October 2008 - 04:20 AM