/    Sign up×
Community /Pin to ProfileBookmark

Hide and Unhide forms!! HELP!!

I already had this working..but when I was fixing the code, well creating the stylesheets and js files so I can have them in a different file and not in each code, when you select to unhide the forms..it all moves from place..and that didnt happen..when you hide it its all ok..but it all moves and looks awful when you unhide it.

Here’s the link so you can see it [URL=”http://lne.mty.itesm.mx/interfaces/gpoCleo/618569/registrar_cliente.html”]link[/URL]

The hiding and unhiding..is the radio button that says Si and No besides “Factura”, can anyone please check the code and tell me whats wrong…the due date for this project is tomorrow!!

to post a comment
JavaScript

7 Comments(s)

Copy linkTweet thisAlerts:
@TJ111Oct 30.2007 — I don't see any button at all.

Edit: Oh, let me try those radio buttons you mentioned :o
Copy linkTweet thisAlerts:
@TJ111Oct 30.2007 — Instead of "style.display=none" use visibility. "style.visibility = 'hidden'", "style.visibility = 'visibile'"/
Copy linkTweet thisAlerts:
@nestor_cantuauthorOct 30.2007 — let me try it..
Copy linkTweet thisAlerts:
@nestor_cantuauthorOct 30.2007 — i just changed it like this:

document.getElementById('facturacion').style.visibility = 'hidden', style.visibility = 'visible';

but that wont make it even hidden..it just looks all messed up
Copy linkTweet thisAlerts:
@nestor_cantuauthorOct 30.2007 — the hiding i've already changed it to

document.getElementById('facturacion').style.visibility = 'hidden';

and the unhiding looks like this

var z = document.getElementById('facturacion');

z.style.visibility = (this.value=="yes")?'':'visible';

the hiding doesnt work and at first it looks all messed up
Copy linkTweet thisAlerts:
@TJ111Oct 30.2007 — You can try changing the CSS classes, then having the visibility declared in the CSS. Can you upload it so I can see whats happening?
Copy linkTweet thisAlerts:
@savvykmsOct 30.2007 — The CSS [I]display[/I] property defines if an element on a page is even rendered. Using javascript to edit it can make something disappear, this is best used when floating objects, this form however is on the page itself, and thus you can hide it, but with the page contents moving around due to new empty space. The CSS [I]visibility[/I] property defines if an element on a page is visable, meaning it takes up space unlike when display is 'none'. Therefore your hide/unhide thing would work best if it was visbility, which can be defined in a class such as:

.invisable { visibility: hidden; }

.visable { visibility: visible; }

In javascript, the thing to change it is this:

document.pathtoit.className = 'invisable|visable';

Where pathtoit can be document.getElementById(id) or some other method such as document.all.id, and where invisable or visable is specified.
×

Success!

Help @nestor_cantu 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

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