How do i make the javascript check the amount

broberg

No avatar

2007-01-29 12:35

Hi, I was wondering.

How can I change the javascript to check the $aList[fSummary] variable?
I've stared at the javascript code for hours now, can't figure all the functions out..

I want it to check that the amount is not under a certain number.

treewood (OpenSolution)

Avatar: treewood

2007-01-29 16:02

broberg - hmm... this will not be easy. You should know HTML good. Edit in QC 2.0, templates/orders_delivery.tpl add (in COURIER block) input type hidden with value $aList[fSummary]. something like that:
<input type=''hidden'' name='fSummary' value='$aList[fSummary]' />
after find

Change this:
onsubmit=''return checkForm( this, aCheckFormDelivery );''
to something like this:
onsubmit=''return checkOrder( this, aCheckFormDelivery );''

after add JavaScript code and function for example:

<script type='text/javascript'>
<!--
function 
checkOrderoFormaCheckFormDelivery ){
  if( 
oForm['fSummary'] < 1000 ){ 
    
// change this value to Your minimum order amount
    
alert'Order more!!!' );
    return 
false;
  }
  else{
    return 
checkFormoFormaCheckFormDelivery );
  }
// end function 
//-->
</script>



I dont test it. Maybe it will helps. Check and give info

Back to top
about us | contact