/    Sign up×
Community /Pin to ProfileBookmark

HTML/Javascript FORM Problem

I’ve got a contact form at [url]http://www.ashtonmortonslack.co.uk/v2/nhs/index.php[/url]

I want the form to hide the bottom two fields and display one or the other depending on what the nature of the enquiry is. Is there some HTML/ Javascript code that does this and can anyone point me in the right direction.

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@TheBearMayDec 09.2005 — To start off not displaying the fields just add

style="display:none" (also will want to give them an id using id="someUniqueId")

to the element tags. Then when you want to expose them it's just a matter of excuting a little Javascript that reads

document.getElementById("someUniqueId").style.display="inline";
Copy linkTweet thisAlerts:
@martinsandhuauthorDec 09.2005 — cheers i've messed around with it and it works ok. In IE perfect however in FF it doesn't display as it should. Any ideas?

http://www.ashtonmortonslack.co.uk/v2/nhs/index.php
Copy linkTweet thisAlerts:
@CytaelDec 10.2005 — Only problem I see in FF is that your general enquiry box is showing up on the wrong side of the table, but I don't see any reason in the code that should be happening:

[code=html]<tr>
<td width="166" style="display:none;" id="messageareatext"><span class="style3">Message:</span></td>
<td style="display:none;" id="messagearea"><span class="style3">

<textarea name="message" cols="25" rows="5" id="message"></textarea>
</span></td>
</tr>
[/code]

only thing i can think of is that you might play around with the number of columns in the box
×

Success!

Help @martinsandhu 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.2,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...