[ic] help--validation script

Jeannie Stevenson webteam at wes-state.com
Tue Apr 27 17:39:28 EDT 2004


good day list

I'm having trouble with a script to validate criteria

Here is what I'm trying to do
I have certain products that I don't ship to certain states
I've created a column called 'not_avail' in the products table
In the variable table I've created a variable with the states that I don't
ship to
>From checkout when they enter their state a javascript popup is created

The script that I'm having trouble with is...

[if items]
    <SCRIPT>    // JavaScript Form Validation Demo
    function check_avail(form) {
        var foundState = false;
  [calc]
   if($Items->[n]{code}) {
    return q{var ch = 'NEVAIRBE';}
     unless $Tag->item_list({
      'body' => "[item-code] [item-field not_avail]"
   })
   return q{var ch = form.state.value;}
  [/calc]
        ch = ch.toUpperCase();
                [loop list="__STATE_AVAIL__"]
        if(ch == "[loop-code]") {
            alert("You ordered sku(s) [item-code]\nThese programs are not
available to [loop-code] residents");
            foundState = true;
        }
                [/loop]
        return foundState;
    }
    </SCRIPT>
[/if]

It won't validate the SKU from the cart against the ship to state

Any help would be greatly appreciated

Thanks

Jeannie




More information about the interchange-users mailing list