View Full Version : Javascript not working in liquid css button

10-22-2010, 08:39 AM
I am redesigning a web application . I want to introduce color themes in it. When i click on a particular theme i want a new look to appear including buttons. For this i m using the below css code which uses only 3 button images(single image sliced in 3)wherin only the background color is to be changed thru css and new button gets created.

body {
margin: 0;
padding: 10px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 14px;
.btn {
float: left;
clear: both;
background: url(images/btn_left.png) no-repeat;
padding: 0 0 0 10px;
margin: 5px 0;
.btn a{
float: left;
height: 40px;
background: url(images/btn_stretch.png) repeat-x left top;
line-height: 40px;
padding: 0 10px;
color: #fff;
font-size: 1em;
text-decoration: none;
.btn span {
background: url(images/btn_right.png) no-repeat;
float: left;
width: 10px;
height: 40px;
.btn_addtocart { background-color: green; }

HTML code:

<div class="btn btn_addtocart"><a href="#>Submit</a><span></span></div>
<div class="clear"></div>
Background Color: Red

The earlier web application used:

<input type="image" onclick="javascript:return validate()>
wherin the validate function includes
function validate()
var user = document.login.loginid.value;
var pwd = document.login.loginid.value;

alert("Enter user name");
return false;
alert("Enter password");
return false;
return true;

I cannot use javascript:return validate() with this new html code
<div class="btn btn_addtocart">
<a href="#>Submit</a><span></span></div>
<div class="clear"></div>
Background Color: Red

Please provide me with a new javascript code to run the above css code or similar css code to run this javascript.

10-22-2010, 02:57 PM
I dont really know how to help you but I would love to see what this looks like when its done

I would check it through w3c validator though just to see if youre missing any end tags or something

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum