-
trapping a submit
Hi
I know I can use Get_LastClick to trap a submit but how can I do the equivalent of the following to create a msgbox?
btnSendLive.Attributes.Add"onclick", "javascript:return confirm('Are you sure you want to send out all the emails in Essential Skills Collection table?');")
Thanks
Bob
-
This one requires a JS guru and is beyond me. Seems like once the popup, the Form info might be lost.
I think the popular way to do this is to display a confirmation form like an order confirmation and then ask user to click the confirm button. This would avoid popup blockers also. The conformation for is another aspx or the same aspx with a different entry parameter (program.aspx?Choice=2). It also can be a popup.
Frank
-
ok - I just thought there may be a way of using the button generated by Tornado.
Bob
-
Let us know if you find a fancy way to do it.
FK
-
Bob,
If I understand you correctly, this is simple. Use the EditValidateName parameter in your Mydb.dbEditParams statement and put this code in your validation function:
<SCRIPT LANGUAGE="JavaScript">
function EditValidate() {
answer = confirm("U sure?");
if (answer == "true") {
return true; // accept the submit
}else{
return false; // go back to the form
}
}
</SCRIPT>
I hope that helps.
-Mark
-
Mark
I am looking for the example to show me how to use editvalidatename. The link to the example is:
http://www.aspdb.com/Site/tor/eg_EditUpdate.aspx
but it comes up with an error msg: can't find the resource.
Bob
-
ok - the example is working again but I am not sure how to incorporate the function you supplied with the dbEditParams property. Can you help?
Thanks
-
Bob,
x.dbEditParams = "TableName=Email,BookMarkFlds=0,TableTag=Border=2, EditValidateName=EditValidate()"
See Programming Example 105 at:
http://www.aspdbtest.com/examples/ViewPro/
-Mark
-
Mark
I have found a sample and incorporated it into a test page but I can't get it working - here it is:
<%@page language = "vb" %>
<script runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
Dim strSQL as string = "Select * From customers where customerID = 'FRANK'"
DisplayGrid(strSQL)
End Sub
sub DisplayGrid(strSelect as string)
Dim EditAll As New tornado.z
With EditAll
.dbUnit = 777
.dbSkin = 12
.dbMode = "grid"
.dbQP="eaf=EditValidate()"
.dbtype = "sql"
.dbCulture="en-GB"
.dbBookmark="customers;0"
.dbEditAddFlds = "0,1,2"
.dbPageSize=15
.dbDSN=application("nwindsql")
.dbSQL = strSelect
.dbNavigationItem = "add,update"
.dbstatusbar="true"
.dbGridDisplayFlds = "1,2,3,4"
.ASPdbNET()
end with
end sub
</script>
<body>
<head>
<SCRIPT LANGUAGE="JavaScript">
function EditValidate() {
answer = confirm("U sure?");
if (answer == "true") {
return true; // accept the submit
}else{
return false; // go back to the form
}
}
</SCRIPT>
</head>
</body>
Bob
-
Bob,
I don't think QuickProps supports EditValidate. Contact me directly. I have a working example.
Thanks,
Mark
-
Try the following ->
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
function MyJS() {
answer = confirm("U sure?");
if (answer == "true") {
return true; // accept the submit
}else{
return false; // go back to the form
}
}
</SCRIPT>
</HEAD>
<script language='vb' runat='server'>
Sub Page_Load(Source as Object, E as EventArgs)
Dim JS As New tornado.z()
With JS
.dbQP = "U=1| D=NWIND| S=8| GDF=0,1,2,3| Ni=b5,update,add| euf=0,1,2| eaf=0,1,2| bm=customers;0| evn=MyJS()| TH=title=JS"
.dbSQL = "Select * From customers where customerID = 'FRANK'"
.ASPdbNET()
End With
End Sub
</Script>
-
Quick Props "evn"?
Is that new?
It's not documented anywhere, is it?
-Mark
-
No, it is not new. Actually I have to look it up to confirm.... editvalidatename should be EVN.
This app is very interesting.. I'll have to post that after it all works...
Frank
-
This Edit Confirm example is added to the "Edit" Manual page.
Frank
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|