/    Sign up×
Community /Pin to ProfileBookmark

Hi,
In my form i need to make a row invisible/visible by clicking a button. Let’s say there are 20 check boxes along with other input tags on the form like following :

<form name=”frm”>

<tr bgcolor=”FFC0CB”>
<input type=checkbox name=”c1″>First name
<input type=checkbox name=”c2″>Last Name
……
…..
</tr>
<tr>
<input type=text name=”t1″>
<input type=text name=”t2″>
…..
</tr>

</form>

I’d like to make visible/invisible the entire row which is included of check boxes and lables.

Thanks for sgaring your idea. Would be perfect if any code is available.

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@Khalid_AliNov 06.2003 — assign an id attribute with some value to the tr(row) and the using

document.getElementById("trID").visibility="hidden"

visibility="visible"

you can also use

display="none"

or display="block"; depending upon the general page design
Copy linkTweet thisAlerts:
@chadorbafauthorNov 06.2003 — Khalid,

Thanks for the replay.

I tried both visibility & display with no success. Is that depended to the browser or i missed something? or maybe i have to reload the page? i use IE 6.

Please advise.

ali
Copy linkTweet thisAlerts:
@Khalid_AliNov 06.2003 — chances are that you are not implementing the suggestion corectly,

show me the code(preferably if you have link to actual page)
Copy linkTweet thisAlerts:
@chadorbafauthorNov 06.2003 — here is the code:

window.frames[1].document.getElementById("chkrow").visibility="hidden";

also tried:

window.frames[1].document.getElementById("chkrow").display="none";


and added id to the row:

<tr id="chkrow" bgcolor="FFC0CB">

<input type=checkbox name="c1">First name

<input type=checkbox name="c2">Last Name

......

.....

</tr>
Copy linkTweet thisAlerts:
@chadorbafauthorNov 07.2003 — Khalid,

Tons of thanks for your help. finally got it to work. Here is the code.


<script>

var ob=document.getElementById("chkrow");

if (ob.style.display=="none") ob.style.display="";


else ob.style.display="none";

</script>


<tr bgcolor="FFC0CB">

<td id="chkrow">

<input type=checkbox name="c1">First name

<input type=checkbox name="c2">Last Name

......

.....

<td>

</tr>


Thanks once again.

ali
×

Success!

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