?
Solved

how to hide radio button and text area

Posted on 2003-11-09
8
Medium Priority
?
1,425 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
8 Comments
 
LVL 31

Expert Comment

by:seanpowell
ID: 9710068
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
ID: 9710076
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 100 total points
ID: 9710209
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
Are You Using the Best Web Development Editor?

The worlds of web hosting and web development are constantly evolving. Every year we see design trends change, coding standards adapt and new frameworks/CMS created. With such a quick pace of change it’s easy to get lost trying to keep up.

See if your editor made the list.

 

Expert Comment

by:prashantuchil
ID: 9712904
Hi,

    i think u could simply put all the things u want to hide in a <div> tag ... and hide the div.
0
 
LVL 11

Expert Comment

by:Zontar
ID: 9713018
>  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
ID: 9715589
<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
ID: 9718949
Looks like the "just hide the TR" camp received another vote. ;)
0
 

Expert Comment

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

Featured Post

Enroll in August's Course of the Month

August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to prepare an HTML email signature template file containing dynamic placeholders for users' Azure AD data. Furthermore, it explains how to use this file to remotely set up a department-wide email signature policy in Office …
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
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…
Suggested Courses

752 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