Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Confirmation box in my ASP page

Status
Not open for further replies.

david7777777777

Programmer
Sep 26, 2001
417
US
I've been looking around in here and I think I've actually seen too much helpful information believe it or not. So here's all I need. This is for an ASP page talking to SQL 2000 using vbscript on the server.

I have a form and its submit button is already doing some things. I'd also like the submit button onClick to display a message box to the user asking them if they've printed this page/form yet. If they respond yes then go ahead and submit. If they respond no then I'd like the print dialog box to automatically open, or at least just keep the form active with the user-inserted dta still intact so they can print the page before submitting it. Thanks.
 
I don't know how to call the print page but here is another solution.

1. First change the submit button to a normal image.
2. <a href=&quot;javascript:goSubmit;&quot;><img src='submit.gif' vspace='0' hsapce='0' alt='Submit the Page' border='0'></a>

here is the javascript goSubmit function

function goSubmit{
if (confirm(&quot;Did you print the page?&quot;) == true)
{
document.frmMain.action = 'vieworderitem.asp;'
document.frmMain.method = 'POST';
document.frmMain.submit();
}
else
{
return;
}
}

 
Thank you, but I'm looking for a solution that will work with my button DTC.
 
david(7*10)
<input type=&quot;Submit&quot; value=&quot;submit&quot; onclick=&quot;return printed()&quot;>



<script language=&quot;javascript&quot;>
function printed()
{
var clickok = window.confirm(&quot;Did you print yet?\n Click OK to continue. Click Cancel to stop.&quot;);

if (clickok == false)
{ return false; }
else
....your code here
return true;
}



fengshui_1998
 
Here's the existing code for my submit button onClick event if this helps clarify what I'm trying to accomplish:

Sub btnSave_onclick()
dim fieldsarray(26)
dim valuesarray(26)
fieldsarray(0) = &quot;txtTrackingNumber&quot;
fieldsarray(1) = &quot;txtDateSent&quot;
fieldsarray(2) = &quot;txtReturnDate&quot;
fieldsarray(3) = &quot;lstOrigin&quot;
fieldsarray(4) = &quot;lstDestination&quot;
fieldsarray(5) = &quot;lstSentBy&quot;
fieldsarray(6) = &quot;txtTape01&quot;
fieldsarray(7) = &quot;txtTape02&quot;
fieldsarray(8) = &quot;txtTape03&quot;
fieldsarray(9) = &quot;txtTape04&quot;
fieldsarray(10) = &quot;txtTape05&quot;
fieldsarray(11) = &quot;txtTape06&quot;
fieldsarray(12) = &quot;txtTape07&quot;
fieldsarray(13) = &quot;txtTape08&quot;
fieldsarray(14) = &quot;txtTape09&quot;
fieldsarray(15) = &quot;txtTape10&quot;
fieldsarray(16) = &quot;txtTape11&quot;
fieldsarray(17) = &quot;txtTape12&quot;
fieldsarray(18) = &quot;txtTape13&quot;
fieldsarray(19) = &quot;txtTape14&quot;
fieldsarray(20) = &quot;txtTape15&quot;
fieldsarray(21) = &quot;txtTape16&quot;
fieldsarray(22) = &quot;txtTape17&quot;
fieldsarray(23) = &quot;txtTape18&quot;
fieldsarray(24) = &quot;txtTape19&quot;
fieldsarray(25) = &quot;txtTape20&quot;
fieldsarray(26) = &quot;txtComments&quot;
valuesarray(0) = txtTrackingNumber.value
valuesarray(1) = txtDateSent.value
valuesarray(2) = txtReturnDate.value
valuesarray(3) = lstOrigin.getValue
valuesarray(4) = lstDestination.getValue
valuesarray(5) = lstSentBy.getValue
valuesarray(6) = txtTape01.value
valuesarray(7) = txtTape02.value
valuesarray(8) = txtTape03.value
valuesarray(9) = txtTape04.value
valuesarray(10) = txtTape05.value
valuesarray(11) = txtTape06.value
valuesarray(12) = txtTape07.value
valuesarray(13) = txtTape08.value
valuesarray(14) = txtTape09.value
valuesarray(15) = txtTape10.value
valuesarray(16) = txtTape11.value
valuesarray(17) = txtTape12.value
valuesarray(18) = txtTape13.value
valuesarray(19) = txtTape14.value
valuesarray(20) = txtTape15.value
valuesarray(21) = txtTape16.value
valuesarray(22) = txtTape17.value
valuesarray(23) = txtTape18.value
valuesarray(24) = txtTape19.value
valuesarray(25) = txtTape20.value
valuesarray(26) = txtComments.value
rsShipments.updateRecord fieldsarray, valuesarray
btnSave.hide
lblInfo2.show
lblInfo3.hide
lblInfo4.hide
lblInfo5.hide
lblInfo6.hide
lblTrackingNumber.hide
lblDateSent.hide
lblReturnDate.hide
lblOrigin.hide
lblDestination.hide
lblSentBy.hide
lblTape01.hide
lblTape02.hide
lblTape03.hide
lblTape04.hide
lblTape05.hide
lblTape06.hide
lblTape07.hide
lblTape08.hide
lblTape09.hide
lblTape10.hide
lblTape11.hide
lblTape12.hide
lblTape13.hide
lblTape14.hide
lblTape15.hide
lblTape16.hide
lblTape17.hide
lblTape18.hide
lblTape19.hide
lblTape20.hide
lblComments.hide
lstOrigin.hide
lstDestination.hide
lstSentBy.hide
txtTrackingNumber.hide
txtDateSent.hide
txtReturnDate.hide
txtTape01.hide
txtTape02.hide
txtTape03.hide
txtTape04.hide
txtTape05.hide
txtTape06.hide
txtTape07.hide
txtTape08.hide
txtTape09.hide
txtTape10.hide
txtTape11.hide
txtTape12.hide
txtTape13.hide
txtTape14.hide
txtTape15.hide
txtTape16.hide
txtTape17.hide
txtTape18.hide
txtTape19.hide
txtTape20.hide
txtComments.hide
End Sub
 
DTC is Design Time Control. It's something we beginners like to use to reduce the amount of hard coding required. Using DTC's comes at a price though; lot's of headaches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top