473,385 Members | 1,620 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Show the content using dropdown options

3
Expand|Select|Wrap|Line Numbers
  1. <td>Rooms :</td><td>
  2. <select name="Room1">
  3.   <option>1</option>
  4.   <option>2</option>
  5.   <option>3</option>
  6.   </select></td>

When i select room 1 from the above drop down then the below field i.e details 4 room 1 should get display...

Expand|Select|Wrap|Line Numbers
  1. <tr><td><font color="Red">*</font>Rooms Type :</td><td>
  2. <select name="Roomtype1">
  3.   <option>Double</option>
  4.   <option>Twin</option>
  5.   <option>Double plus 1 child</option>
  6.   <option>Twin plus 1 child</option>
  7. <option>Twin for sole use</option>
  8. <option>Single</option>
  9. <option>Triple</option>
  10. <option>Quadruple</option>
  11. </select></td>
  12. <td> Adults :</td><td>
  13. <select name="Adults1">
  14.   <option>1</option>
  15.   <option>2</option>
  16.   <option>3</option>
  17.   <option>4</option>
  18. <option>5</option>
  19. <option>6</option>
  20. <option>7</option>
  21. <option>8</option>
  22. <option>9</option>
  23. <option>10</option>
  24. </select></td>
  25. <td>Children :</td><td>
  26. <select name="Child1">
  27. <option>0</option>
  28.   <option>1</option>
  29.   <option>2</option>
  30.   <option>3</option>
  31.   <option>4</option>
  32. <option>5</option>
  33. <option>6</option>
  34. <option>7</option>
  35. <option>8</option>
  36. <option>9</option>
  37. <option>10</option>
  38. </select></td></tr>

and when i select 2 then details of room1 and room2 shld display...


Expand|Select|Wrap|Line Numbers
  1. <select name="Roomtype2">
  2.   <option>Double</option>
  3.   <option>Twin</option>
  4.   <option>Double plus 1 child</option>
  5.   <option>Twin plus 1 child</option>
  6. <option>Twin for sole use</option>
  7. <option>Single</option>
  8. <option>Triple</option>
  9. <option>Quadruple</option>
  10. </select></td>
  11. <td> Adults :</td><td>
  12. <select name="Adults2">
  13.   <option>1</option>
  14.   <option>2</option>
  15.   <option>3</option>
  16.   <option>4</option>
  17. <option>5</option>
  18. <option>6</option>
  19. <option>7</option>
  20. <option>8</option>
  21. <option>9</option>
  22. <option>10</option>
  23. </select></td>
  24. <td>Children :</td><td>
  25. <select name="Child2">
  26. <option>0</option>
  27.   <option>1</option>
  28.   <option>2</option>
  29.   <option>3</option>
  30.   <option>4</option>
  31. <option>5</option>
  32. <option>6</option>
  33. <option>7</option>
  34. <option>8</option>
  35. <option>9</option>
  36. <option>10</option>
  37. </select></td></tr>
And similar when i select 3....


please reply ASAP
Thanks in advance....
Jun 6 '12 #1

✓ answered by acoder

Do you mean Microsoft Access?

I've already shown how you can get the selected value. I should add that you will need to add the value property for the options for some browsers:
Expand|Select|Wrap|Line Numbers
  1. <option value="1">1</option>
There are other alternatives to get the selected value, but this is the simplest.

3 2209
acoder
16,027 Expert Mod 8TB
The simplest way to do this is to have the dropdowns hidden initially (except perhaps the ones for room 1).

Then show the others using the onchange event, e.g.
Expand|Select|Wrap|Line Numbers
  1. <select name="Room1" onchange="call_function_here()">
Note that this is inline, but it would be better to move this out of the HTML.

To get the current selected value, you can simply get the value property, e.g.
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('Room1').value;
assuming you add an ID of "Room1".

To show/hide objects, set the display property to "block"/"none" respectively.

A better method, though, is to add the options dynamically depending on the selection.
Jun 14 '12 #2
Sofi02
3
thank u ....
Can help me in updating in acess???
and retrieving same value depending on number of room select....
Jun 17 '12 #3
acoder
16,027 Expert Mod 8TB
Do you mean Microsoft Access?

I've already shown how you can get the selected value. I should add that you will need to add the value property for the options for some browsers:
Expand|Select|Wrap|Line Numbers
  1. <option value="1">1</option>
There are other alternatives to get the selected value, but this is the simplest.
Jun 20 '12 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Irmen de Jong | last post by:
Hi I'm trying to create e-mail content using the email.MIMEText module. It basically works, until I tried to send mail in non-ascii format. What I did, to test both iso-8859-15 and UTF-8...
3
by: Lars G. Svensson | last post by:
Currently, I'm marking up a few pages in German, containing quite some English abbreviations. The abbreviations are marked up as <abbr> with the appropriate title attribute, and -- when appropriate...
0
by: sub | last post by:
I'm using plone primary as a news system for my school. Now I want to integrate external sources into my plone site. The page is...
3
by: Adam | last post by:
Hello. Let's say I have a dropdown in a form like this: <SELECT NAME = "ShippingMethod"> <OPTION VALUE = "ptbship:Standard Ground Service" shipindex="1" shipcost="9.00">Standard Ground...
3
by: =?Utf-8?B?bGpsZXZlbmQy?= | last post by:
I need to show a custom control in the DropDown of a Windows.Forms.ToolStripMenuItem (e.g., similar to the Font Color menu item in Word except that the control is specific to my application). I...
1
by: basavaraj koti | last post by:
I need to show image using xslt Below provided in my xml and xslt. <?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet type="text/xsl" href="../xyz.xsl"?> <Grade class="03"...
4
by: J MCallister | last post by:
Hello, I am working on a shopping cart where the viewer sees a dropdown with shipping options, each with a price. Elsewhere on the page is a display of the total. I am working on having the...
2
by: mukeshrasm | last post by:
hello i want to display the subjects on the same page based on class selected by user. i am using dropdown for classes. so when user will select a particular class then it will display subjects in...
1
by: gopim | last post by:
i write the code like this function show() { var subject=document.getElementById('<%=ddlsubject.ClientID %>'); var txtsubject=document.getElementById('<%=TextBox1.ClientID%>');...
9
by: JoeKid09 | last post by:
Hi All, Thank you in advance for your valuable help. I'm working on a project in which I have a form with 3 listbox each one of them has long string content. So I would like to be able to allow...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.