/    Sign up×
Community /Pin to ProfileBookmark

Working on a form and i wanted to have a field pop up if a parent field was selected.
Example, If i select switch, I want fields IP, MAC and Serial to show.
Or if i select wap i want fields SSID MAC and IP to show.
I think i need to use javascript to do this
the way I have it working now is when you hit the submit button those fields show. I wanted this to happen the second the select field was selected.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NightShift58Feb 08.2007 — Yes, you'll have to use JS for that.

You'll have to use <DIV id=xxx>field label</DIV> for the labels you want to "pop" in and out of your form.

The parent field will need to include an onchange=yyy() and within the JS function yyy(), you'll need to assign a value to xxx.innerHTML to make something pop in between the appropriate <DIV></DIV>.

Hopefully, you're as confused as I am by now... ? nach dem Motto: Alle Klarheiten beseitigt..."
Copy linkTweet thisAlerts:
@prophitauthorFeb 08.2007 — I think i have the basic concept. I will play around with it. I need to learn more javascript.. lol
Copy linkTweet thisAlerts:
@CharlesFeb 08.2007 — I think i have the basic concept. I will play around with it. I need to learn more javascript.. lol[/QUOTE]Be careful that you don't wreck your page for the teeming masses who don't use JavaScript. Instead of assigning to, the non-standard, HTMLElement.innerHTML have everything present in the HTML itself. Then onload change the CSS display to "none" and then toggle with JavaScript as needed.
Copy linkTweet thisAlerts:
@NightShift58Feb 08.2007 — Be careful that you don't wreck your page for the teeming masses who don't use JavaScript. ... and then toggle with JavaScript as needed.[/QUOTE]I'm confused...
Copy linkTweet thisAlerts:
@prophitauthorFeb 09.2007 — uhh me too

as towely would say " I have no idea whats going on right now"
Copy linkTweet thisAlerts:
@NightShift58Feb 09.2007 — No, Charles is right. I'm wrong. I understand what he meant now.

Doing was he says means that if javascript is DISABLED, all the information would be displayed. If javascript is ENABLED, then the javascript would first render all the information invisible and selectively display this or that information.

The problem with your application is that your users simly must have javascript enabled, as you rely on it in many other places.

So, in summary, Charles is right, but in your particular case, it doesn't matter because your site has already fallen for javascript, hook, line and sinker...
×

Success!

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