Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Javascript in odd places (fails validation)

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-20-2005, 01:10 AM
 
Mr Bob Mr Bob is offline
 

Senior Member
  
Join Date: Jul 2005
Posts: 199
 

Default Javascript in odd places (fails validation)

Good ole document type does not allow element "script" here

There is an issue with the place that the javascript is being placed. Issue is in both the check_options.tpl and the customer_options.tpl file.

How do you get around this failed validation?

The customer_options.tpl file:

Code:
{* $Id: customer_options.tpl,v 1.16.2.4 2005/03/02 06:16:56 max Exp $ *} {if $product_options ne ''} <script type="text/javascript" language="JavaScript 1.2"> var alert_msg = '{$alert_msg}'; </script> {include file="modules/Product_Options/check_options.tpl"} {foreach from=$product_options item=v} {if $v.options ne '' || $v.is_modifier eq 'T'} <tr> <td valign="middle" height="25">{if $usertype eq "A"}{$v.class}{else}{$v.classtext|default:$v.class}{/if}</td> <td valign="middle"> {if $cname ne ""} {assign var="poname" value="$cname[`$v.classid`]"} {else} {assign var="poname" value="product_options[`$v.classid`]"} {/if} {if $v.is_modifier eq 'T'} <input id="po{$v.classid}" type="text" name="{$poname}" value="{$v.default|escape}"> {else} <select id="po{$v.classid}" name="{$poname}"{if $disable} disabled{/if} onchange="javascript: check_options();"> {foreach from=$v.options item=o} <option value="{$o.optionid}"{if $o.selected eq 'Y'} selected{/if}>{$o.option_name}{if $v.is_modifier eq 'Y' && $o.price_modifier ne 0} {/if}</option> {/foreach} </select> {/if} </td> </tr> {/if} {/foreach} {/if} {if $product_options_ex ne ""} <tr> <td colspan="2"><font id="exception_msg" color="red">{if $err ne ''}{/if}</font></td> </tr> {if $err ne ''} <tr> <td colspan="2"><FONT class="CustomerMessage">{$lng.txt_product_options_combinations_warn}:</FONT></td> </tr> {foreach from=$product_options_ex item=v} <tr> <td>{foreach from=$v item=o}{if $usertype eq "A"}{$o.class}{else}{$o.classtext}{/if}: {$o.option_name} {/foreach} </td> </tr> {/foreach} {/if} {/if}
__________________
Product: X-Cart Gold
Current version: 4.0.14

Additional Mods: X-Affiliate
Reply With Quote
  #2  
Old 11-20-2005, 01:58 AM
  Zaja's Avatar 
Zaja Zaja is offline
 

X-Adept
  
Join Date: Mar 2004
Location: The Universe is my home
Posts: 420
 

Default

Javascript tags must go outside the table tags or inside the td tags to validate...nothing follows the table tag except tr or th......and use CDATA for check_options.tpl.
Code:
<script type="text/javascript"> //<![CDATA[ {include file="modules/Product_Options/check_options.tpl"} //]]> </script>
__________________
_/ _/ _/ _/ _/ _/ _/ _/ _/

7dana.com
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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
Forum Jump


All times are GMT -8. The time now is 10:58 AM.

   

 
X-Cart forums © 2001-2020