Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Validating Oscommerce


Recommended Posts

Hi all,


ive recently set about validating a copy of oscommerce, its gone well and im left with only one error that wont comply with xhtml 1.0 strict..

I know its not essential and its took me some time to do this but ive learnt much..


Now my problem is after all this im left with one error on the product info page, this error is coming from a contribution i added which enables users to enter there personalized comments in a text area..


Now my problem is the text area has a id hence wont validate..


Validation Output: 1 Error


1. Error Line 287, Column 17: character "[" is not allowed in the value of attribute "id".


id="id[txt_30]" >



It is possible that you violated the naming convention for this attribute. For example, id and name attributes must begin with a letter, not a digit.


so im just wondering if any one out there knows any work arounds for this..


Many thanks for any replies this may get..

Link to comment
Share on other sites

Is any Javascript running on your page that has any control over the textarea? If not then I don't see the need for the "id" attribute at all. Have you tried removing it to see if it breaks functionality?

Link to comment
Share on other sites

you may want to follow the link in my signature to see how I did it. It complies with xhtml1.0 Strict.



commercial support - unProtected channel, not to be confused with the forum with same name - open to everyone who need some professional help: either PM/email me, or go to my website (URL can be found in my profile).

over 20 years of computer programming experience.

Link to comment
Share on other sites

Hi Kaine..


thanks for the input,much appreciated


yes the textarea has javascript that controls how much a user can enter so they dont get carried away..


 <td style="width:200px; font-size:10px"><?php echo $tmp_html;  ?></td>

		//CLR 030714 Add logic for text option
		$products_attribs_query = tep_db_query("select distinct patrib.options_values_price, patrib.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id='" . (int)$HTTP_GET_VARS['products_id'] . "' and patrib.options_id = '" . $products_options_name['products_options_id'] . "'");
		$products_attribs_array = tep_db_fetch_array($products_attribs_query);
	$tmp_html = '<textarea onkeydown="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onkeyup="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')" 
							   onfocus="textCounter(this,\'progressbar' . $products_options_name['products_options_id'] . '\',' . $products_options_name['products_options_length'] . ')"  
							   name="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" 
							   id="id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']" >' . $cart->contents[$HTTP_GET_VARS['products_id']]['attributes_values'][$products_options_name['products_options_id']] . '
</textarea>' . '
					<div id="progressbar' . $products_options_name['products_options_id'] . '" class="progress"></div>
					<script type="text/javascript">textCounter(document.getElementById("id[' . TEXT_PREFIX . $products_options_name['products_options_id'] . ']"),"progressbar' . $products_options_name['products_options_id'] . '",' . $products_options_name['products_options_length'] . ')</script>';?>	<!-- DDB - 041031 - Form Field Progress Bar //-->


there is in fact two id tags in there so bit of a pain, i just didnt know if there was a work around..


thanks again for reply..



Link to comment
Share on other sites

Thanks Ken..


i will give that a read through as it would be a shame to leave just one error when some pages started with over 300!!!



Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

  • Create New...