Adobe Dreamweaver Forums



Last 10 THreads :         Writing mxml transition in as3 (Last Post : SiHoop - Replies : 0 - Views : 1 )           »          Is There An Extension that Renames Layers Based on MovieClip Names of Files (Last Post : fcastro75 - Replies : 4 - Views : 5 )           »          file directory. (Last Post : Alan - Replies : 10 - Views : 11 )           »          Lining up flash video in different browsers... (Last Post : Jasper Thayer - Replies : 1 - Views : 2 )           »          Uploading Streaming Video (Last Post : K.A.M. - Replies : 2 - Views : 6 )           »          How do I Set Text of Container? (Last Post : lazybones99 - Replies : 2 - Views : 3 )           »          Locking resize handles in browser. (Last Post : emilio_tha_don - Replies : 10 - Views : 11 )           »          gesture driven scrolling list (Last Post : cntpmaxn - Replies : 64 - Views : 953 )           »          Formatting Text Paragraph (Last Post : BudHud - Replies : 0 - Views : 1 )           »          Tutorial Announcement :: Dynamic DropDwon Accordion Panel :: (Last Post : Günter_Schenk@adobeforums.com - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Dreamweaver: Main > Dreamweaver Application Development
 
Tags:

Reply
  #1 (permalink)  
Old 07-24-2008, 06:18 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Minimum order on a shopping cart?

I have a shopping cart page and I want to apply a minimum order restriction
of $6 to it. The form tag looks like this -

<form action="<?php echo
($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>"
method="post" onSubmit="minimumCheck(<?php echo
$ADTCart->TotalColumn("TotalPrice") ?>)">

The function itself is this -

<script type="text/javascript">
function minimumCheck(value) {
if (value < 6.00) {
alert("There is a $6.00 minimum order at blahblahblah.com");
return false;
}
}
</script>


The javascript fires, and pops the alert, but the form submits! Why is that
return false not kicking in?

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-24-2008, 06:18 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: Minimum order on a shopping cart?

Got it - changed the function to this -

<script type="text/javascript">
function minimumCheck(value) {
if (value < 6.00) {
alert("There is a $6.00 minimum order at Armydogtags.com");
return false;
}
return true;
}
</script>

and the form tag to this -

onSubmit="return(minimumCheck(<?php echo $ADTCart->TotalColumn("TotalPrice")
?>))">


--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Murray *ACE*" <forums@HAHAgreat-web-sights.com> wrote in message
news:g6aeup$q41$1@forums.macromedia.com...
>I have a shopping cart page and I want to apply a minimum order restriction
>of $6 to it. The form tag looks like this -
>
> <form action="<?php echo
> ($_SERVER["PHP_SELF"].(isset($_SERVER["QUERY_STRING"])?"?".htmlentities($_SERVER["QUERY_STRING"]):""));?>"
> method="post" onSubmit="minimumCheck(<?php echo
> $ADTCart->TotalColumn("TotalPrice") ?>)">
>
> The function itself is this -
>
> <script type="text/javascript">
> function minimumCheck(value) {
> if (value < 6.00) {
> alert("There is a $6.00 minimum order at blahblahblah.com");
> return false;
> }
> }
> </script>
>
>
> The javascript fires, and pops the alert, but the form submits! Why is
> that return false not kicking in?
>
> --
> Murray --- ICQ 71997575
> Adobe Community Expert
> (If you *MUST* email me, don't LAUGH when you do so!)
> ==================
> http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
> http://www.dwfaq.com - DW FAQs, Tutorials & Resources
> ==================
>
>


Reply With Quote
  #3 (permalink)  
Old 07-24-2008, 10:27 PM
Michael White
 
Posts: n/a
Diggs:
Default Re: Minimum order on a shopping cart?

Murray *ACE* wrote:
> Got it - changed the function to this -
>
> <script type="text/javascript">
> function minimumCheck(value) {
> if (value < 6.00) {
> alert("There is a $6.00 minimum order at Armydogtags.com");
> return false;
> }
> return true;
> }
> </script>
>
> and the form tag to this -
>
> onSubmit="return(minimumCheck(<?php echo
> $ADTCart->TotalColumn("TotalPrice") ?>))">
>
>

There should be a space between return and "(":

onSubmit="return minimumCheck(<?php echo
$ADTCart->TotalColumn("TotalPrice") ?>);">

Mick
Reply With Quote
  #4 (permalink)  
Old 07-24-2008, 11:51 PM
Murray *ACE*
 
Posts: n/a
Diggs:
Default Re: Minimum order on a shopping cart?

Ahh - thanks, Mick. Turns out the cart has multiple ways to submit the form
(clear, update, keep shopping, and checkout) so having it on the onsubmit
event was not optimal. I moved it to the checkout button, and it works a
treat, I think!

--
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.projectseven.com/go - DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs, Tutorials & Resources
==================


"Michael White" <mwhite13@rochester.rr.com> wrote in message
news:g6au28$coa$1@forums.macromedia.com...
> Murray *ACE* wrote:
>> Got it - changed the function to this -
>>
>> <script type="text/javascript">
>> function minimumCheck(value) {
>> if (value < 6.00) {
>> alert("There is a $6.00 minimum order at Armydogtags.com");
>> return false;
>> }
>> return true;
>> }
>> </script>
>>
>> and the form tag to this -
>>
>> onSubmit="return(minimumCheck(<?php echo
>> $ADTCart->TotalColumn("TotalPrice") ?>))">
>>
>>

> There should be a space between return and "(":
>
> onSubmit="return minimumCheck(<?php echo
> $ADTCart->TotalColumn("TotalPrice") ?>);">
>
> Mick


Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 01:47 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Inactive Reminders By Mished.co.uk