473,425 Members | 1,734 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,425 software developers and data experts.

CSS submit button problem

I'm seeing some odd behavior related to CSS and a form, and I'm
wondering if anyone has seen this before and whether they might have a
solution.

I have a small form that is displayed inside a table cell. The tags
are nested like this:

<form><td> ... form elements etc... </td></form>

There are no CSS styles applied to the body, table, table row, form,
or table cell. However, I have applied styles to the individual form
elements.

Specifically, I have applied the following style to the submit button:

.smallbutton {
border : 1px solid Black;
background-color : #CCCCCC;
font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;
font-size : xx-small;
font-weight : bold;
}

What I have noticed is that any time I click inside the table cell,
the submit button's border goes from 1px to 2px. If I click outside
the table cell, it goes back to 1. This is only with IE 6.

I would really like to know why it happens and how to prevent it, if
possible. It sure seems weird.
cookie.

Jul 23 '05 #1
13 13034
cookie monster wrote:
I'm seeing some odd behavior related to CSS and a form, and I'm
wondering if anyone has seen this before and whether they might have a
solution.

I have a small form that is displayed inside a table cell. The tags
are nested like this:

<form><td> ... form elements etc... </td></form>
Oh dear! If this is your actual markup, it's invalid. TR elements can
contain only TH and TD elements, not FORM elements. Of course, since
you didn't provide a URL, we don't know what your markup really looks
like, or if something you didn't share with us is the real cause of
the problem.
I would really like to know why it happens and how to prevent it, if
possible. It sure seems weird.


Without a URL, we can only go by the snippets (possibly incorrectly
transcribed) that you provided. Validate your HTML and your CSS.
Correct any errors discovered. If the problem persists, post a URL
to the actual page so we can examine your markup in situ.

--
Steve

If men could regard the events of their own lives with more open minds,
they would frequently discover that they did not really desire the
things they failed to obtain. -Emile Herzog
Jul 23 '05 #2
This is the HTML, very simple in the end:

<form action="test" method="post" name="testform" id="testform">
<table cellspacing="2" cellpadding="2" border="0" width="25%"
class="formtable">
<tr>
<td class="formHead" colspan="2">TESTFORM</td>
</tr>
<tr class="formline">
<td>button 1</td>
<td><input type="submit" name="ok1" value="ok1"
class="submit"
onMouseover="classChange('mouseover',this)"
onMouseout="classChange('submit',this)"
onClick="classChange('click',this)"
tabindex="1" /></td>
</tr>
</table>
</form>
The CSS:

/* style for form submit buttons */
input.submit {
background-color: #FFFFFF;
border: 2px solid;
border-color:#199B37;
color : #199B37;
font-weight: bold;
font-family : Arial, Verdana, Helvetica, Sans-Serife;
font-size: 9pt;
text-align : center;
cursor:pointer;
}
Cheers,
Cookie
On Thu, 17 Mar 2005 07:23:56 -0500, "Steve Fulton"
<ce********@hotmail.com> wrote:
cookie monster wrote:
I'm seeing some odd behavior related to CSS and a form, and I'm
wondering if anyone has seen this before and whether they might have a
solution.

I have a small form that is displayed inside a table cell. The tags
are nested like this:

<form><td> ... form elements etc... </td></form>


Oh dear! If this is your actual markup, it's invalid. TR elements can
contain only TH and TD elements, not FORM elements. Of course, since
you didn't provide a URL, we don't know what your markup really looks
like, or if something you didn't share with us is the real cause of
the problem.
I would really like to know why it happens and how to prevent it, if
possible. It sure seems weird.


Without a URL, we can only go by the snippets (possibly incorrectly
transcribed) that you provided. Validate your HTML and your CSS.
Correct any errors discovered. If the problem persists, post a URL
to the actual page so we can examine your markup in situ.


Jul 23 '05 #3
me
"cookie monster" <no****@nowhere.com> wrote in message
news:n6********************************@4ax.com...
This is the HTML, very simple in the end:

<form action="test" method="post" name="testform" id="testform">
<table cellspacing="2" cellpadding="2" border="0" width="25%"
class="formtable">
<tr>
<td class="formHead" colspan="2">TESTFORM</td>
</tr>
<tr class="formline">
<td>button 1</td>
<td><input type="submit" name="ok1" value="ok1"
class="submit"
onMouseover="classChange('mouseover',this)"
onMouseout="classChange('submit',this)"
onClick="classChange('click',this)"
tabindex="1" /></td>
</tr>
</table>
</form>
The CSS:

/* style for form submit buttons */
input.submit {
background-color: #FFFFFF;
border: 2px solid;
border-color:#199B37;
color : #199B37;
font-weight: bold;
font-family : Arial, Verdana, Helvetica, Sans-Serife;
font-size: 9pt;
text-align : center;
cursor:pointer;
}
Cheers,
Cookie


For starters the table is busted. Note: colspan=2 below:
Good Luck,
me

<form method="post" action="">
<table width="25%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="2">TESTFORM</td>
</tr>
<tr>
<td>button 1</td>
<td>
<input type="submit" name="ok1" value="ok1">
</td>
</tr>
</table>
</form>
Jul 23 '05 #4
me
"cookie monster" <no****@nowhere.com> wrote in message
news:n6********************************@4ax.com...
This is the HTML, very simple in the end:

<form action="test" method="post" name="testform" id="testform">
<table cellspacing="2" cellpadding="2" border="0" width="25%"
class="formtable">
<tr>
<td class="formHead" colspan="2">TESTFORM</td>
</tr>
<tr class="formline">
<td>button 1</td>
<td><input type="submit" name="ok1" value="ok1"
class="submit"
onMouseover="classChange('mouseover',this)"
onMouseout="classChange('submit',this)"
onClick="classChange('click',this)"
tabindex="1" /></td>
</tr>
</table>
</form>
The CSS:

/* style for form submit buttons */
input.submit {
background-color: #FFFFFF;
border: 2px solid;
border-color:#199B37;
color : #199B37;
font-weight: bold;
font-family : Arial, Verdana, Helvetica, Sans-Serife;
font-size: 9pt;
text-align : center;
cursor:pointer;
}
Cheers,
Cookie


Note that style class names must start with a period. See below:
Good Luck,
me

<style type="text/css">
<!--
..submit { background-color: #FFFFFF; border-color: #199B37; border: 2px
#199B37 solid; font-family: Arial, Helvetica, sans-serif; font-weight: bold;
font-size: 9pt}
-->
</style>
Jul 23 '05 #5
cookie monster wrote:

What I have noticed is that any time I click inside the table cell,
the submit button's border goes from 1px to 2px. If I click outside
the table cell, it goes back to 1. This is only with IE 6.

I would really like to know why it happens and how to prevent it, if
possible. It sure seems weird.

Without an URL it is difficult to say. My WAG is that windows/IE is
putting a border around the button to indicate that it is selected and has
focus. Make a small test case where the button is not surrounded by a
table so you can better see what's happening.

--
jmm dash list (at) sohnen-moe (dot) com
(Remove .AXSPAMGN for email)
Jul 23 '05 #6
me wrote:
input.submit {
Note that style class names must start with a period. See below:
No, class names should avoid starting with a period, otherwise you have to
escape them in the style sheet, and that quickly gets messy.

In a style sheet, the class selector starts with a period character - but
the previous poster has done that. He simply combined the class selector
with a type selector which is perfectly allowable under the specification.
(Its worth avoiding since it adds slightly to the processing the browser
has to do, but its not a serious problem).
<style type="text/css">
<!--
Avoid this cargo cult. Its a waste of time and will cause problems with any
future migration to XHTML.
font-size: 9pt}


It would have been far more useful to pick up on this point though. Point
units are, as has been discussed many times in the history of this group
(and more in the ciwa.stylesheets sister group), entirely unsuitable for
use on screen.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #7
me wrote:
<td class="formHead" colspan="2">TESTFORM</td>
For starters the table is busted. Note: colspan=2 below:


He already has colspan=2. Although that element should be a caption or at
least a table header cell rather then a table data cell.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #8
me
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
me wrote:
input.submit {
Note that style class names must start with a period. See below:
No, class names should avoid starting with a period, otherwise you have to
escape them in the style sheet, and that quickly gets messy.

In a style sheet, the class selector starts with a period character - but
the previous poster has done that. He simply combined the class selector
with a type selector which is perfectly allowable under the specification.
(Its worth avoiding since it adds slightly to the processing the browser
has to do, but its not a serious problem).


DW will not allow a custom class name to start with any character other than
a period. On page 258 of DW3 for Windows and Mac it states "class name must
start with a period".
<style type="text/css">
<!--


Avoid this cargo cult. Its a waste of time and will cause problems with

any future migration to XHTML.


The OP made no mention of needing XHTML.
font-size: 9pt}


It would have been far more useful to pick up on this point though. Point
units are, as has been discussed many times in the history of this group
(and more in the ciwa.stylesheets sister group), entirely unsuitable for
use on screen.


I didn't choose a fixed font size the OP did. As for using fixed font sizes
we must agree to disagree on this point. Personally I would have used
pixels to denote font size.

In closing I would ask why you made no attempt whatsoever to offer the OP
enlightenment regarding his query? Maybe the answer is because it's often
easier to criticize those who try to help rather than giving help yourself.
Signed,
me
Jul 23 '05 #9
me
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
me wrote:
<td class="formHead" colspan="2">TESTFORM</td>

For starters the table is busted. Note: colspan=2 below:


He already has colspan=2. Although that element should be a caption or at
least a table header cell rather then a table data cell.


My bad, eyes failing, tiny text in news reader, etc etc etc.
Signed,
me
Jul 23 '05 #10
me wrote:
No, class names should avoid starting with a period, otherwise you have
to escape them in the style sheet, and that quickly gets messy.
DW will not allow a custom class name to start with any character other
than a period. On page 258 of DW3 for Windows and Mac it states "class
name must start with a period".
Then either Dreamweaver is _very_ broken, or what it calls "class name" is
really a class selector. I'm betting on the latter.
> <style type="text/css">
> <!--


Avoid this cargo cult. Its a waste of time and will cause problems with
any future migration to XHTML.


The OP made no mention of needing XHTML.


That doesn't make it wise to stick HTML comments in a style sheet.
> font-size: 9pt}
It would have been far more useful to pick up on this point though.

I didn't choose a fixed font size the OP did.
Did I say otherwise?
As for using fixed font sizes we must agree to disagree on this point.
Personally I would have used pixels to denote font size.
Pixels have their problems. Points have far more problems (all the problems
of pixels, with the addition of most systems interpeting them incorrectly).
Are you really disagreeing with the widely held assesment that points
(specifically points, not absolute units in general) are unsuitable?
In closing I would ask why you made no attempt whatsoever to offer the OP
enlightenment regarding his query?
He didn't a provide a URL. My Windows machine isn't plugged in at the
moment. The solution to his problem was non-obvious.
Maybe the answer is because it's often
easier to criticize those who try to help rather than giving help
yourself.


Correcting bad advice is help.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #11
me
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
[snip]

Can you answer the OP's questions?
Signed,
me
Jul 23 '05 #12
me wrote:
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
[snip]

Can you answer the OP's questions?


Why are you obsessing over my ability to answer that question? It doesn't
alter the fact that the response you gave needed to be corrected.

--
David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Jul 23 '05 #13
me
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
me wrote:
"David Dorward" <do*****@yahoo.com> wrote in message
news:d1*******************@news.demon.co.uk...
[snip]

Can you answer the OP's questions?


Why are you obsessing over my ability to answer that question? It doesn't
alter the fact that the response you gave needed to be corrected.


The answers to those and other questions must be non-obvious to you. Have a
nice day.
Signed,
me
Jul 23 '05 #14

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

Similar topics

3
by: Matt | last post by:
I want to understand the difference between submit button and regular button: <input type="submit"> and <input type="button">. My understanding is that submit button will send the entire HTML form...
15
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
6
by: CJM | last post by:
Can somebody clarify if/how/when a simple form is submitted when the <Enter> key is pressed? As I understood it, if you have a form with a single submit button, if enter is pressed, the form...
2
by: Margaret Werdermann | last post by:
Hi all: I'm having a nasty time with a particularly difficult piece of code and was hoping someone might be able to help me. I have a FormMail form that originally worked perfectly. Then, I...
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...
5
by: rjames.clarke | last post by:
I have the following. $result=mysql_query($sql); $nrows=mysql_num_rows($result); for ($i=0;$i<$nrows;$i++) { $row_array=mysql_fetch_row($result); echo "<form name='testform'...
3
by: Jeff | last post by:
I have a payment form with a submit button. A large percentage of users double-click the submit button thus submitting their payment information twice. I would like to use javascript to disable...
1
by: B Ekre | last post by:
In VS 2005 I have a WebForm with 3 UserControls on it. One UserControl implements the new ICallbackEventHandler to update a DIV based on user input. The other two implement a <asp:repeater ...>...
8
by: kj | last post by:
Is there a simple way to decouple the value attribute of a submit button from the text that actually gets displayed on it? In principle, what I'm looking for is something like <input...
7
by: Petr Vileta \(fidokomik\) | last post by:
I have a form with few text inputs. Every text input is followed by image type input. In this form I want to have 1 submit button on the top. A problem I want to resolve is: when user type...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.