Solved

how to hide radio button and text area

Posted on 2003-11-09
8
1,421 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 50 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
Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style elements, such a divs, with a "drop shadow" effect using the CSS box-shadow property Start with a normal styled element, such as a div.: In the element's style, type the box shadow property: "box-shad…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

696 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