Post by Qphoria » Tue Apr 21, 2009 3:50 am

SiteE@se wrote: There are also examples at http://www.dynamicdrive.com/style/cssli ... tegory/C7/ with well-commented (although slightly bulky) code.
Those examples all use the same method used with 1.x.. you still need javascript to submit forms.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SiteE@se » Tue Apr 21, 2009 6:06 am

Qphoria wrote: Those examples all use the same method used with 1.x.. you still need javascript to submit forms.
We seem to be going in circles here ;) I was responding to Daniel's comment that you can't have nice buttons if you don't use jscript, which of course you can, a la CSS examples quoted.

I think the main issue is that in 1.x.jscript is being used for form submission rather than traditional form/post. Personally I prefer traditional html forms but only because I find them easier to code. As long as jscript isn't introducing accessibility issues (like the 'enter' one that started all this) then I'll live with either.

Chris

Active Member

Posts

Joined
Mon Dec 17, 2007 7:40 am
Location - UK

Post by Qphoria » Tue Apr 21, 2009 6:32 am

I think he meant you can't have nice "form" buttons if you don't use javascript.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by SiteE@se » Tue Apr 21, 2009 6:50 am

That's the point - you CAN have nice form buttons without javascript, as referred to earlier .....

Active Member

Posts

Joined
Mon Dec 17, 2007 7:40 am
Location - UK

Post by make-oc » Tue Apr 21, 2009 10:39 am

Daniel is saying you can not style a submit button

Code: Select all

<input type="submit" value="Submit" />
as nice as a Link

Code: Select all

<a href="#" tabindex="20">text</a>
using just CSS
and he is absolutely right there!

Having said that, I'd like to add, there is no reason for

Code: Select all

<?php echo '<?xml version="1.0" encoding="UTF-8"?>' . "\n"; ?>
when declaring a

Code: Select all

<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en" xml:lang="en">
in the same Document!
This has the same effect as for the xml standard used and if the server isn't set to UTF8 anyway – just use

Code: Select all

header('content-type: text/html; charset=utf-8');
in the PHP files.

In IE6 anything before the <!DOCTYPE> tag, it will make IE6 enter into quirks mode and render html quite differently!
OK again IE6… but removing

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
will make it much, much easier for those who wanna add some IE6 CSS — simply test this in the Demo-Shop — once the <?xml version="1.0" encoding="UTF-8"?> is removed it already looks much, much better in IE6!

Cheers
Last edited by make-oc on Tue Apr 21, 2009 10:52 am, edited 3 times in total.

New member

Posts

Joined
Tue Apr 07, 2009 2:17 pm

Post by make-oc » Tue Apr 21, 2009 10:40 am

Almost forgot…
The reason why you can not use the EnterKey is simply the lack of the form tag.
So to make the QuickSerch in the header work I just edidted the template:

Code: Select all

++<form action="">
++<input name="route" type="hidden" value="product/search" />
  <?php if ($keyword) { ?>
  <input type="text" name="keyword" value="<?php echo $keyword; ?>" id="filter_keyword" />
  <?php } else { ?>
  <input type="text" name="keyword" value="<?php echo $text_keywords; ?>" id="filter_keyword" onclick="this.value = ''" />
  <?php } ?>
  <a onclick="location = 'index.php?route=product/search&keyword=' + encodeURIComponent($('#filter_keyword').attr('value'));" class="button"><span><?php echo $button_search; ?></span></a>
++</form>
</div>

This leaves the pretty buttons and still get's you the expected behavior of a form.

Cheers

New member

Posts

Joined
Tue Apr 07, 2009 2:17 pm

Post by SiteE@se » Tue Apr 21, 2009 4:02 pm

Always so many ways to skin the rabbit ;) Thanks!

Active Member

Posts

Joined
Mon Dec 17, 2007 7:40 am
Location - UK

Post by powermikee » Sun Apr 11, 2010 3:30 pm

You can't have pretty buttons without Javascript?!..What the?? Do any of you actually use CSS?? I have been using expandable images for buttons for years it's very possible:

You can view a sample here http://webmagic.com.au/button_image

This is how it's done with only one background image and sprites:

Code: Select all

<style>
.new_button{
	list-style:none; 
	padding:0; 
	margin:0;
}
.new_button li{ 
	float:left;
}
.new_button li.left{
	background:url(button_image.png)  0 2px no-repeat; 
	width:10px;
	height:25px;
}
.new_button li.right{
	background:url(button_image.png)  right 2px no-repeat; 
	width:10px;
	height:25px;
}
.new_button .input2{ 
	border:0;
	background:url(button_image.png) 0 2px no-repeat; 
	color:#FFFFFF; 
	height:27px;
	font-weight:bold; 
	outline:none; 
	padding:0px;
	cursor:pointer;
}
html>/**/body .new_button .input2, x:default{ 
	/* firefox fix */
	height:25px;
}
.new_button li.middle{ 
	/* chrome fix */
	background:url(button_image.png) -30px 2px no-repeat;
}
</style>

<form method="post" action="index.html" >

<ul class="new_button">
    <li class="left"></li>
    <li class="middle">
    	<button class="input2" name="submit" type="submit">Check Out</button>
    </li>
    <li class="right"></li>
</ul>

</form>
To use simply add your own BG image...to have dynamic button text simply change 'Check Out' with the php. For example the search button is <?php echo $button_go; ?>

I have seen it work with IE 6+, firefox, chrome, netscape and safari.

Daniel this is something that can definitely be fixed...pages should degrade smoothly if there is no JS.

Newbie

Posts

Joined
Thu Mar 18, 2010 9:56 pm

Post by Qphoria » Mon Apr 12, 2010 12:23 am

No.. you can't have pretty buttons without hardcoded languages on images. This is extremely inefficient. You would need new button images for each language.
If you want this, goto zencart.

Just add <noscript> tags to the top of your page and be done with it.

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am
Who is online

Users browsing this forum: No registered users and 8 guests