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

Add a css class to this javascript

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 12-28-2010, 07:15 PM
 
mmoskva mmoskva is offline
 

eXpert
  
Join Date: Aug 2005
Location: Pennsylvania
Posts: 306
 

Default Add a css class to this javascript

Q. What script do I need to add so this javaScript will use a css class?

Quote:

This is the .css class:
INPUT.large {
BORDER-BOTTOM: #b3b3b3 1px solid; BORDER-LEFT: #b3b3b3 1px solid; PADDING-LEFT: 2px; PADDING-TOP:2px;
BACKGROUND: url(images/custom/Ibg.gif) repeat-x left bottom; HEIGHT: 19px; WIDTH: 258px; COLOR: #000000; BORDER-TOP: #b3b3b3 1px solid; BORDER-RIGHT: #b3b3b3 1px solid;


This is the Javascript that I currently have
<script language="javascript">
{literal}

function clear_border(form_name) {
form = document.getElementById(form_name);
for(i in form.elements) {
if (form.elements[i]) {
type = form.elements[i].type;
if (type == 'text') {
form.elements[i].style.border = '1px solid #b3b3b3'; <!-- Input Boarder -->
form.elements[i].style.background = '#FFFFFF';
el = document.getElementById(form.elements[i].name+'_label');
if (el) {
el.style.fontSize = '12px';
el.style.color = '#656565';
}
}
}
}
el = document.getElementById('card_expire_border');
if (el) {
el.style.fontSize = '12px';
el.style.border = '0px solid #FFFFFF';
el.style.background = '#FFFFFF';
}
el = document.getElementById('card_expire_label');
if (el) {
el.style.fontSize = '12px';
el.style.color = '#000000';
}

el = document.getElementById('error_messages');
if (el) el.style.display = 'none';
}
{/literal}
</script>
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 12:34 AM.

   

 
X-Cart forums © 2001-2020