/    Sign up×
Community /Pin to ProfileBookmark

Hi,

I’m working with a form where I have two things going on:

1). A radio button which toggles the visibility of a section. This works with a JS file with the following code:

[CODE]function offtutored(){
document.getElementById(“hidetutored”).style.display = ‘none’;
}
function ontutored() {
document.getElementById(“hidetutored”).style.display = ”;
}[/CODE]

Then in my code I supply my <tr> with “hidetutored” for the section to initially hide. This works fine when applying onclicks to the radio buttons.

2). Several checkboxes that when a particular one is clicked, shows another text field. This works with the following CSS & JS:

CSS:

[CODE]#aa{visibility:hidden;}[/CODE]

JS:

[CODE]function toggle(chkbox, group) {
var visSetting = (chkbox.checked) ? “visible” : “hidden”
document.getElementById(group).style.visibility = visSetting
}[/CODE]

Then my checkbox:

[CODE]<input name=”education[]” type=”checkbox” id=”education” value=”MA/MS” onclick=”toggle(this, ‘ma’)”/>[/CODE]

My question is this: In my case, when the extra fields show, they are required. The problem is that with JS disabled, these fields do not show. Thus the form will never work properly in this case and will not be allowed to submit. Does anyone see in my code where I can make these fields show when JS is disabled?

Thanks for any input,

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@ryanbutlerauthorJul 05.2007 — No one??
×

Success!

Help @ryanbutler 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.18,
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,
)...