473,785 Members | 3,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Show/Hide table row

Aly
I am building a site that sells 3 standard packages and one custom package.
On the package selection page, I want the following:

Upon loading the page, I want the package selections (Basic, Standard,
Advanced, and Custom) to be visible, as well as an Email field and Payment
Method field.

I want nothing to happen when Basic, Standard, or Advanced are clicked. When
Custom is clicked (radio buttons for all), I want the custom options to
appear. If Basic, Standard, or Advanced are chosen again, I want the custom
options to disappear.

I have found a few different codes, but none of them do exactly what I am
looking for. I have seen it done, and tried to copy the code, but it didn't
work. I'm assuming there was something in a .js file that affected it.

If anyone could help, I would be greatly appreciative.

Aly
Jan 17 '06 #1
4 5407
Aly
Following up on myself...

I have found one script that almost does what I want. However, I'm unsure
how to make it work for more than 2 options. Here is the basic page html
including the script so that someone may be able to help me.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitl ed Document</title>
<script language="JavaS cript" type="text/JavaScript">
function ref(object)
{
if (document.getEl ementById)
{
return document.getEle mentById(object );
}
else if (document.all)
{
return eval('document. all.' + object);
}
else
{
return false;
}
}

function expand(object)
{
var object = ref(object);

if( !object.style )
{
return false;
}
else
{
object.style.di splay = '';
}

if (window.event)
{
window.event.ca ncelBubble = true;
}
}

function contract(object )
{
var object = ref(object);

if( !object.style )
{
return false;
}
else
{
object.style.di splay = 'none';
}

if (window.event)
{
window.event.ca ncelBubble = true;
}
}

function toggle(object)
{
object = ref(object);
if( !object.style )
{
return false;
}

if( object.style.di splay == 'none' )
{
object.style.di splay = '';
}
else
{
object.style.di splay = 'none';
}
}
</script>

</head>

<body>
<table width="100%" border="1" cellpadding="5" cellspacing="0"
bordercolor="#0 00000">
<tr>
<td bgcolor="#CCCCC C">
Hide Extra Content
<select name="select" onchange="toggl e('morestuff'); return false;">
<option value="Yes" selected>Yes</option>
<option value="No">No</option>
</select></td>
</tr>
<tr>
<td bgcolor="#CCCCC C">Here is some content that shows. </td>
</tr>
<tbody id="morestuff" style="display: none">
<tr>
<td bgcolor="#33FF0 0"><p>This is hidden content</p>
</td>
</tr>
<tr>
<td bgcolor="#FFFF0 0">This is hidden content </td>
</tr>
<tr>
<td bgcolor="#FF66C C">This is hidden content </td>
</tr>
</tbody>
<tr>
<td bgcolor="#CCCCC C">Here is more content that shows. </td>
</tr>
</table>
</body>
</html>
Jan 17 '06 #2
On 2006-01-17, Aly <al********@sha w.ca> wrote:
I have found a few different codes, but none of them do exactly what I am
looking for. I have seen it done, and tried to copy the code, but it didn't
work. I'm assuming there was something in a .js file that affected it.


more likely there was something wrong with the HTML

Bye.
Jasen
Jan 19 '06 #3
On 17/01/2006 18:45, Aly wrote:

[snip]
Upon loading the page, I want the package selections (Basic, Standard,
Advanced, and Custom) to be visible, as well as an Email field and Payment
Method field.

I want nothing to happen when Basic, Standard, or Advanced are clicked. When
Custom is clicked (radio buttons for all), I want the custom options to
appear. If Basic, Standard, or Advanced are chosen again, I want the custom
options to disappear.


Could you please post a link to the document as it stands now. It would
be much easier to describe a solution if we can see precisely what
markup will be involved (especially if changes to that markup are
necessary).

[snip]

Mike

--
Michael Winter
Prefix subject with [News] before replying by e-mail.
Jan 19 '06 #4
Aly

"Michael Winter" <m.******@bluey onder.co.uk> wrote in message
Could you please post a link to the document as it stands now. It would be
much easier to describe a solution if we can see precisely what markup
will be involved (especially if changes to that markup are necessary).


Actually, it's not necessary :) I managed to figure it out on my own, and it
now works marvelously :) Thanks, though!

Aly
Jan 19 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
2310
by: Michael Skind | last post by:
Hello, I use a simple Table : <TABLE> <TR 1> <TD></TD> </TR> <TR 2> <TD></TD> </TR>
7
4157
by: Mad Scientist Jr | last post by:
Through messing around I got IE6 (win xp) to show/hide a table row. I gave my <TR> an ID of "trRow" and trRow.style.display='none'; hides it trRow.style.display='block'; displays it (will any value other than 'none' display on IE6?) I tried enclosing the <TR></TR> inside a <DIV> tag, and hiding that, but it doesn't work for some reason.
10
4658
by: oLE | last post by:
I would like to add some javascript to show/hide a certain row of a table. The first row of the table contain the hyperlink that calls the javascript the second row is the one i want to show/hide with the javascript in a toggle fashion. the problem is a know very little javascript and have become incredibly frustrated because i went ahead thinking it was going to be like C. its not. I know i can use these lines to do the actual work:
2
12190
by: MOHSEN KASHANI | last post by:
Hi, I am trying to hide some form elements in a form by default and show/hide depending on which radio button is clicked. This is what I have but it is not working: <head> <style> ..noshow { display: none; }
11
8083
by: jimstruckster | last post by:
I have a table with 10 rows, I want all rows except for the first to be hidden when the page first opens up. If the user puts a value in a text box in the first row then I want the second row to display. If they put a value in the text box in the second row then display the third row etc. etc. etc. to 10 rows. I'm pretty new to javascript, so I'm not to sure where to start. Any help would be great, thanks a lot.
6
1998
by: michael941 | last post by:
Hi, I have 2 tables in an html page. I have div them separately and id them as id1 and id2. I have a link there. What I need is click the link to hide one table and show the other and verse when click the link again. I tried many ways in javascript but failed. Could someone please help? Thanks a lot!
1
4173
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
18
7570
by: Liquidtouch | last post by:
I have been searching on this for awhile and cant find anything and playing around with it got me no where. I will start with what I am after and then explain what I have. I have a table with 3 rows and 2 columns. I would like on page load to only have one row visible with the bottom two rows hidden. I would like to have an "add" button on the bottom most visible row. When you click the "add" button it adds a row to the bottom and moves the...
1
3812
oranoos3000
by: oranoos3000 | last post by:
hi would you please help me i have a online shopping center that i show pictures of the my product in home page. in the InterExplorer pictures is shown correctly but in Firefox browser is shown properties alt in img tag istead of picture . place of the pictures is saved in the database(my database is with mysql) and in home page i fetch properties of the product and address of place that pictures is located output of the code in the...
0
9645
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4053
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3646
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.