Solved

how to hide radio button and text area

Posted on 2003-11-09
8
1,416 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
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
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

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 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 viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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…

860 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