an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Double check Zip and Address before Submit Order
Last Post 11/9/2010 3:49:43 PM By Bahram. 5 replies.
11/8/2010 11:57:27 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Double check Zip and Address before Submit Order
 Hi Luke,
 
I need to popup a Window to ask user check his Zip and address before submitting Order. What is a similar code in DSC for pop a window up?
 
Thanks,
11/9/2010 10:06:30 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Double check Zip and Address before Submit Order
Hi Luke,
 
This is a common user problem, they mis-type their address and the shipping delivery fails: What I need is a pop up warning window before submitting order :
 
protected void btnSubmitOrder_Click(object sender, EventArgs e)
{
Need a Warnning Popup before Submit code
}
 
This is my solution :
 

I added this line at PageLoad:

protected void Page_Load(object sender, EventArgs e)
{
......  
 btnSubmit.Attributes.Add("onclick", "return ConfirmInfo();");
<font size="2" face="Consolas"><font size="2" face="Consolas"><font size="2" face="Consolas">} 

 
Then I added this JavaScript code to OnePageCheckout

<script type="text/javascript">
function ConfirmInfo() { 
        if (confirm("Please ensure you enter your information accurately.") == true) return true;
        I NEED TO CALL btnSubmitOrder_CLICK 

</script>

My questions is how to call btnsubmitOrder_click from javascript code

Thanks,

 

 

11/9/2010 10:21:59 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Double check Zip and Address before Submit Order
string.Format("document.getElementById('{0}').click();", btnSubmitOrder.ClientID)
DotShoppingCart Staff
11/9/2010 11:41:56 AM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Double check Zip and Address before Submit Order
I see other scripts, can I use this line of code :
 
else __doPostBack('btnSubmitOrder_Click')
11/9/2010 2:30:41 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Double check Zip and Address before Submit Order
Hi Luke,
 
I removed the onclick tag since I want it to be conditional . In case of yes to popup no action and when reply is no then run the submit script
 
         <asp:ImageButton id="btnSubmit" runat="server" skinid="submitOrder" tooltip="<%$ Resources:Common,SubmitOrder %>"
                validationgroup="checkout" onclick="btnSubmitOrder_Click"/>
 
But your code does not seem to work :
 
   if ( confirm("Please ensure you enter your information accurately.") == false )
             string.Format("document.getElementById('{0}').click();", btnSubmitOrder.ClientID);
11/9/2010 3:49:43 PM
Bahram
Posts: 878
Joined: 12/8/2008
Location:Vancouver, BC Canada
Re: Double check Zip and Address before Submit Order
Actually it is client code (Javascript) that runs or calls Server code (btnSubmitOrder_Click).
Would you please send me this code in jscript