473,385 Members | 1,641 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

CSS button in form

Oh ye Gods of Style, I have been having fun making buttons with CSS:
<div class='cssnav2'>
<a href='#'
onClick="document.location.href='/catalog/index.php?brand=94'">
<img src='images/Scart_buttonl.jpg' alt='Continue Shopping' />
<span>Continue Shopping</span>
</a>
</div>

..cssnav2{
background-image:url(images/Gcart_buttonl2.jpg);
width: 180px;
}
..cssnav2 a:hover img{visibility:hidden}
..cssnav2 span {
position: relative;
float: left;
left: 5px;
top: -22px;
margin: 0px;
padding: 0px;
cursor: pointer;
width: 190px;
height: 14px;
text-align:center;
}


Now I want to use this technique for form submit buttons. Is this
possible ? How do I do it ?

Here is the button I want to replace:

<input type='hidden' name='login_create' value='yes'/>
<input type='image' src='images/Scart_create.jpg' name='login_new'>

When the user hits the button, the next page looks for 'login_create' to
equal 'yes'
Sep 29 '05 #1
6 1865
meltedown wrote:
Oh ye Gods of Style, I have been having fun making buttons with CSS:
<div class='cssnav2'>
<a href='#'
onClick="document.location.href='/catalog/index.php?brand=94'">
Ye gads. What's wrong with href="/catalog/index.php?brand=94"?

And image replacement techniques have accessibility issues. You have an
image, it has alt text, what's wrong with that?
Now I want to use this technique for form submit buttons. Is this
possible ? How do I do it ? <input type='hidden' name='login_create' value='yes'/>
This is XHTML which doesn't conform to Appendix C and shouldn't be served as
text/html.
<input type='image' src='images/Scart_create.jpg' name='login_new'>
This is HTML.
When the user hits the button, the next page looks for 'login_create' to
equal 'yes'


What's wrong with the existing code? It works, its not presentational junk.
There is no need to move it into a stylesheet and have some people be
unable to access the content (and I mean the information, not any
particular rendering of it).

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sep 29 '05 #2
David Dorward wrote:
<input type='hidden' name='login_create' value='yes'/>

This is XHTML which doesn't conform to Appendix C and shouldn't be served as
text/html.


I don't understand this.
Which Appendix C?
Do you mean it's not valid XHTML?
Sep 29 '05 #3
David Dorward wrote:
meltedown wrote:

Oh ye Gods of Style, I have been having fun making buttons with CSS:
<div class='cssnav2'>
<a href='#'
onClick="document.location.href='/catalog/index.php?brand=94'">

Ye gads. What's wrong with href="/catalog/index.php?brand=94"?


Good Point. I didn't write it, I'm using some one else's atrocious code,
and sometime they have javascript for reqasons I don't understand, so I
generally don't mess with it. But this deserves fixing. Thanks for the
tip. Thank for the tip.
And image replacement techniques have accessibility issues. You have an
image, it has alt text, what's wrong with that?
Well I'm making many many websites with the same code, and the buttons
need to be different for each website. If I have 10 buttons with 2
versions each for in and out states, that makes 20 buttons per website.
If I use replacement images I only need 2 buttons per website, one
foreach state. It works well except in forms. I'm tired of making
buttons, and I'm not aware of any problems. Besides, the CSS butotns
look better.
Now I want to use this technique for form submit buttons. Is this
possible ? How do I do it ?
<input type='hidden' name='login_create' value='yes'/>

This is XHTML which doesn't conform to Appendix C and shouldn't be served as
text/html.

<input type='image' src='images/Scart_create.jpg' name='login_new'>

Right Again
I combined them as
<input type='image' src='images/Scart_login.jpg' name='login_return'
value='yes'>
I see so much bogus code its hard to beleive the programmers were that
bad. The real bummer is it was written by people who make twice as much
as I do.

This is HTML.

When the user hits the button, the next page looks for 'login_create' to
equal 'yes'

What's wrong with the existing code? It works, its not presentational junk.
There is no need to move it into a stylesheet and have some people be
unable to access the content (and I mean the information, not any
particular rendering of it).

Are you talking about pre-ie5 ? I'm not worried about that.
Sep 29 '05 #4
meltedown wrote:
David Dorward wrote:
meltedown wrote:

Oh ye Gods of Style, I have been having fun making buttons with CSS:
<div class='cssnav2'>
<a href='#'
onClick="document.location.href='/catalog/index.php?brand=94'">


Ye gads. What's wrong with href="/catalog/index.php?brand=94"?

Good Point. I didn't write it, I'm using some one else's atrocious code,
and sometime they have javascript for reqasons I don't understand, so I
generally don't mess with it. But this deserves fixing. Thanks for the
tip. Thank for the tip.

And image replacement techniques have accessibility issues. You have an
image, it has alt text, what's wrong with that?

Well I'm making many many websites with the same code, and the buttons
need to be different for each website. If I have 10 buttons with 2
versions each for in and out states, that makes 20 buttons per website.
If I use replacement images I only need 2 buttons per website, one
foreach state. It works well except in forms. I'm tired of making
buttons, and I'm not aware of any problems. Besides, the CSS butotns
look better.

Now I want to use this technique for form submit buttons. Is this
possible ? How do I do it ?

<input type='hidden' name='login_create' value='yes'/>


This is XHTML which doesn't conform to Appendix C and shouldn't be
served as
text/html.

<input type='image' src='images/Scart_create.jpg' name='login_new'>


Right Again
I combined them as
<input type='image' src='images/Scart_login.jpg' name='login_return'
value='yes'>
I see so much bogus code its hard to beleive the programmers were that
bad. The real bummer is it was written by people who make twice as much
as I do.

This is HTML.

When the user hits the button, the next page looks for 'login_create' to
equal 'yes'


What's wrong with the existing code? It works, its not presentational
junk.
There is no need to move it into a stylesheet and have some people be
unable to access the content (and I mean the information, not any
particular rendering of it).

Are you talking about pre-ie5 ? I'm not worried about that.

Also, the exisiting code has no up and down state. The rest of the page
has buttons with up and down states and I want them to match.
Sep 29 '05 #5
On Thu, 29 Sep 2005, Antoine Polatouche wrote:
David Dorward wrote:
<input type='hidden' name='login_create' value='yes'/>


This is XHTML which doesn't conform to Appendix C and shouldn't be
served as text/html.


I don't understand this.
Which Appendix C?


If you don't know what's meant by "Appendix C" (of XHTML/1.0) then
what on Earth persuaded you to use XHTML in the first place? You'd be
far safer staying with HTML/4.01, unless and until you have an
overwhelming reason to use XHTML and understand clearly its
implications in a web situation.

IMHO, anyway. Oh, http://www.w3.org/TR/xhtml1/#guidelines
Sep 29 '05 #6

On Thu, 29 Sep 2005, meltedown wrote:
David Dorward wrote:
meltedown wrote:

Oh ye Gods of Style, I have been having fun making buttons with CSS:
<div class='cssnav2'>
<a href='#'
onClick="document.location.href='/catalog/index.php?brand=94'">

Ye gads. What's wrong with href="/catalog/index.php?brand=94"?


Good Point. I didn't write it, I'm using some one else's atrocious code,
and sometime they have javascript for reqasons I don't understand, so I
generally don't mess with it. But this deserves fixing. Thanks for the
tip. Thank for the tip.


This should do the same as the original for those with JavaScript support
(and have it turned on) and still work for those with JavaScript turned
off or with no JavaScript support at all:

<a href='/catalog/index.php?brand=94'
onClick="document.location.href='/catalog/index.php?brand=94';return false">

Actually they should both do the same thing but it's remotely possible
that the JavaScript version is treated differently in some browsers'
history files.
And image replacement techniques have accessibility issues. You have an
image, it has alt text, what's wrong with that?


Well I'm making many many websites with the same code, and the buttons
need to be different for each website. If I have 10 buttons with 2
versions each for in and out states, that makes 20 buttons per website.
If I use replacement images I only need 2 buttons per website, one
foreach state. It works well except in forms. I'm tired of making
buttons, and I'm not aware of any problems. Besides, the CSS butotns
look better.


Try them with Lynx.
Now I want to use this technique for form submit buttons. Is this
possible ? How do I do it ?


<input type='hidden' name='login_create' value='yes'/>

This is XHTML which doesn't conform to Appendix C and shouldn't be served as
text/html.

<input type='image' src='images/Scart_create.jpg' name='login_new'>

Right Again
I combined them as
<input type='image' src='images/Scart_login.jpg' name='login_return'
value='yes'>
I see so much bogus code its hard to beleive the programmers were that
bad. The real bummer is it was written by people who make twice as much
as I do.

This is HTML.

When the user hits the button, the next page looks for 'login_create' to
equal 'yes'

What's wrong with the existing code? It works, its not presentational junk.
There is no need to move it into a stylesheet and have some people be
unable to access the content (and I mean the information, not any
particular rendering of it).

Are you talking about pre-ie5 ? I'm not worried about that.


If content is moved into a stylesheet it's inaccessible to Lynx users.

--
``Why don't you find a more appropiate newsgroup to post this tripe into?
This is a meeting place for a totally differnt kind of "vision impairment".
Catch my drift?'' -- "jim" in alt.disability.blind.social regarding an
off-topic religious/political post, March 28, 2005

Oct 3 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: TrvlOrm | last post by:
Can any one please help me...I am new to JavaScript and I have been struggling with this code for days now and can't figure it out. I would like to get the Buttons to correspond with the action...
15
by: JR | last post by:
Hi. I hope someone out there who is more versed with JavaScript than I can help me with the following annoying problem. Here's the problem. I have a form with the following layout: Column A...
14
by: tshad | last post by:
I posted this on the asp.net group, also. I wasn't sure whether this was an asp.net problem or a javascript problem. I have a page that was originally created from a program I found on the net...
9
by: Melissa | last post by:
What is the code to delete a command button from a form? Can the code be run from the click event of the button to be deleted? Thanks! Melissa
7
by: Miguel Dias Moura | last post by:
Hello, I am working in ASP.net / VB with Access Database. i have a Multipage in my web site with the Submit button as the last button. When the Submit button is pressed i want the form...
29
by: Tom wilson | last post by:
I can't believe this is such an impossibility... I have an asp.net page. It accepts data through on form fields and includes a submit button. The page loads up and you fill out some stuff. ...
18
by: Colin McGuire | last post by:
Hi - this was posted last weekend and unfortunately not resolved. The solutions that were posted almost worked but after another 5 days of working on the code everynight, I am not further ahead....
5
by: Wonder | last post by:
How can I create or use the msgobx to show a message without a default button. The user has explicity to click on the button, so the msgbox closes it. Thanks,
14
by: Kevin | last post by:
A couple of easy questions here hopefully. I've been working on two different database projects which make use of multiple forms. 1. Where's the best/recommended placement for command buttons...
1
by: =?Utf-8?B?UmljaA==?= | last post by:
I placed a button on a form menustrip for the purpose of causing the horizontal scrollbar of my form to appear so that I can access controls outside of the form's current view (the controls are...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.