/    Sign up×
Community /Pin to ProfileBookmark

Simple Problem, Big Headache!

Hi there, i hope someone can help me with this JavaScript problem, as I am quite new to the language.

Here is what I have going so far. I’ve set it up so that once a user CLICKS a radio button, the next part of the form is revealed.

In simple terms Part 4 of the form checks if Part 3 of the form has been checked before it is made visible.

However, now I have a SELECT box that I need to use “onChange” with in order to change the variable Step4 to “true”.

In other words, instead of checking a radio button, I want the next section to be visible by selecting something in the list box.

[CODE]<select size=”10″ name=”Step4″ multiple=”multiple” onChange=”document.optionsform.Step4(“True”);”>
<option value=”A”>A</option>
<option value=”B”>B</option>
<option value=”C”>C</option>
</select>[/CODE]

As you can see above my FORM is called OPTIONSFORM and I need the variable Step4 to be set onChange to “TRUE”. But the above does not work. I know this has to be simple but it’s not working for some reason.

Hope you guys can help! Thanks a lot!

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@OverstatementDec 26.2006 — When you have a problem with Javascript, you should run it in Firefox and get it's errors from Tools->Javascript Console

You set variables with an equal (=) operator. Brackets are for functions. Why are you trying to set a DOM object to "TRUE" anyway? Maybe you mean
[CODE]document.optionsform.Step4.style.display = 'block'[/CODE]

Edit: Wait, that doesn't make any sense. The fact that you are using Step4's OnChange means that it is already visible, right?
×

Success!

Help @madcaesar 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.29,
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,
)...