/    Sign up×
Community /Pin to ProfileBookmark

Style class in html input feild area

Hi all.

Not to sure if this is the right forum but here goes.

I have a form with various feilds and one of them is hidden unless a checkbox is selected. All the rows in the form have a style applied to them and renders the background colour to “#FEFEFE”.

The problem I have is the row with the hidden feild is not showing the same colour. Below is the row concerned.

[code=html]
<tr valign=”baseline”>
<td align=”right” nowrap class=”coursesubheaders”>VAT Number:</td>
<td class=”requiredfeilds”>&nbsp;</td>
<td colspan=”2″ class=”bookingformrowbg” id=”hidden-input” style=”display:none”>
<input name=”vat_number” type=”text” class=”coursetext” id=”vat_number” size=”20″ /></td>
</tr>
[/code]

The function for the hidden feild is:

[code=html]
function unhide (it, box) {
var check = (box.checked) ? “block” : “none”;
document.getElementById(it).style.display = check;
}
[/code]

My question is why is the row with the hidden feild not accepting the style class.

Anyone any ideas.

Many thanks

dereck

to post a comment
CSS

2 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzOct 29.2006 — I think you will need to show us more code for us to be able to help you.

This isn't what you asked about, but I recommend you read these:

[url=http://www.sitepoint.com/article/simple-tricks-usable-forms/2]Simple Tricks for More Usable Forms: Labels[/url]

[url=http://www.webstandards.org/learn/tutorials/accessible-forms/]Accessible HTML/XHTML Forms[/url]

[url=http://www.webaim.org/techniques/forms/]Creating Accessible Forms[/url]
Copy linkTweet thisAlerts:
@timdentyOct 30.2006 — My first thought would be when the row is visible, the only style that is being applied is the inline css - [I]display:block[/I] - it's seems to be ignoring the linked css because it has inline styles associated.

A bit messy, but why not apply all your input field css to the inline styles.
×

Success!

Help @dcjones spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...