Solved

how to hide radio button and text area

Posted on 2003-11-09
8
1,409 Views
Last Modified: 2008-02-07
i want to hide every object that appears in the <tr> and </tr> tags, including Textboxes, radiobuttons and textarea.
i found that i can hide text boxes by using type="hidden" but this this does not apply on radiobuttons and text area. as radiobuttons already have type="radio" and text area do not hide after using type="hidden".

I want every thing present there but hidden. i can cut off the normal text but not the input objects. please take me out of this problem.
0
Comment
Question by:shafiqrao
8 Comments
 
LVL 31

Expert Comment

by:seanpowell
Comment Utility
Use the disabled property:

<form>
<table border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td><input type="text" name="mytextbox" size="10" disabled></td>
    <td><input type="radio" name="myradiobutton" value="circle" disabled></td>
    <td><textarea name="mytextarea" cols="10" rows="3" disabled></textarea></td>
  </tr>
</table>
</form>
0
 
LVL 31

Expert Comment

by:seanpowell
Comment Utility
I may have misunderstood your intent - so you want a textbox, radio button and textarea that no one can see - to pass information into another form/page, etc. ?
0
 
LVL 11

Accepted Solution

by:
Zontar earned 50 total points
Comment Utility
Do you mean you're wanting to hide form elements that were previously shown?

Give the <tr> an id such as <tr id="myTR">

then you can hide the <tr> with a button:

<input type="button" value="Hide Row" onclick="document.getElementById('myTR').style.display = 'none';">

which will not leave any space for the row, or

<input type="button" value="Hide Row" onclick="document.getElementById('myTR').style.visibility = 'hidden';">

will will hide the contents of the row, but not remove the space it takes up in the page.
0
 

Expert Comment

by:prashantuchil
Comment Utility
Hi,

    i think u could simply put all the things u want to hide in a <div> tag ... and hide the div.
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 11

Expert Comment

by:Zontar
Comment Utility
>  i think u could simply put all the things u want to hide in a <div> tag ... and hide the div.

Why use the extra tag when it's not necessary? Just hide the table row.

What exactly are you trying to do, anyway, shafiqrao?
0
 
LVL 16

Expert Comment

by:jaysolomon
Comment Utility
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function toggle(fObj,divRef){
      var el = document.getElementById(divRef);
      el.style.display = (el.style.display == "none")?"":"none";
      fObj.value = (fObj.value == "Show")?"Hide":"Show";
}
// -->
</script>
</head>
<body>
<form name="form1" method="post" action="">
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td><input type="button" name="btn" value="Show" onclick="toggle(this,'radios');"></td>
        <td>&nbsp;</td>
  </tr>
  <tr id="radios" style="display: none;">
    <td>
      yes
      <input type="radio" name="rad1" value="yes">
      no
      <input type="radio" name="rad1" value="no">
      </td>
      <td><input type="text" name="text1"></td>
  </tr>
</table>
</form>
</body>
</html>
0
 
LVL 11

Expert Comment

by:Zontar
Comment Utility
Looks like the "just hide the TR" camp received another vote. ;)
0
 

Expert Comment

by:ScotterMonkey
Comment Utility
<TEXTAREA id='m_description' NAME='m_description' COLS='84' ROWS='15' style="display:none"></textarea>
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

Foreword (July, 2015) Since I first wrote this article, years ago, a great many more people have begun using the internet.  They are coming online from every part of the globe, learning, reading, shopping and spending money at an ever-increasing ra…
Showing your events from Google Calendar in Google Maps Why? I travel all week and I thought it would be ideal if staff in office knew where I was based on my calendar. (OK real reason: my son wanted to see where I would be working, and I thoug…
The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now