Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

javascript using select option

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how i use javascript for select options..any help would be appreciated.....................................



<div class="top_section_com">
<section class="dec">
<select><option value="volvo">All</option>
<option value="volvo">Gurubani</option>
<option value="volvo">kirtan</option>
<option value="volvo">Tabla</option>
<option value="volvo">Dastar</option>
<option value="volvo">Gatka</option>
<option value="volvo">Speech</option>
<option value="volvo">Q-Ans</option>
</select></section></div>
<div class="row">
<div class="twelve columns">
<table class="responsive">
<table border="1" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<th>SNo</th>
<th>RNo</th>
<th>Name</th>
<th>F-Name</th>
<th>Age</th>
<th>Gurbani</th>
<th>Kirtan</th>
<th>Tabla</th>
<th>Dastar</th>
<th>Gatka</th>
<th>Speech</th>
<th>Q-Ans</th>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>MANJINDER KAUR</td>
<td>HARMINDER SINGH</td>
<td>12</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td>p</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td>JASKIRAT SINGH</td>
<td>HARMINDER SINGH</td>
<td>08</td>
<td>p</td>
<td></td>
<td>p</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>3</td>
<td>TARANPREET KAUR</td>
<td>ARMINDER SINGH</td>
<td>05</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>4</td>
<td>MANPREET KAUR</td>
<td>AMRIK SINGH</td>
<td>08</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>5</td>
<td>KARAMJIT SINGH</td>
<td>JASWINDER SINGH</td>
<td>08</td>
<td>p</td>
<td></td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>6</td>
<td>RAJWINDER KAUR</td>
<td>JASWINDER SINGH</td>
<td>12</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>7</td>
<td>7</td>
<td>HARPREET KAUR</td>
<td>JASWINDER SINGH</td>
<td>14</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<div class="top_section_com">
<section class="dec">
<select><option value="volvo">All</option>
<option value="volvo">Gurubani</option>
<option value="volvo">kirtan</option>
<option value="volvo">Tabla</option>
<option value="volvo">Dastar</option>
<option value="volvo">Gatka</option>
<option value="volvo">Speech</option>
<option value="volvo">Q-Ans</option>
</select></section></div>
<div class="row">
<div class="twelve columns">
<table class="responsive">
<table border="1" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<th>SNo</th>
<th>RNo</th>
<th>Name</th>
<th>F-Name</th>
<th>Age</th>
<th>Gurbani</th>
<th>Kirtan</th>
<th>Tabla</th>
<th>Dastar</th>
<th>Gatka</th>
<th>Speech</th>
<th>Q-Ans</th>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>MANJINDER KAUR</td>
<td>HARMINDER SINGH</td>
<td>12</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td>p</td>
<td></td>
<td></td>
</tr>
<tr>
<td>2</td>
<td>2</td>
<td>JASKIRAT SINGH</td>
<td>HARMINDER SINGH</td>
<td>08</td>
<td>p</td>
<td></td>
<td>p</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
</tr>
<tr>
<td>3</td>
<td>3</td>
<td>TARANPREET KAUR</td>
<td>ARMINDER SINGH</td>
<td>05</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>4</td>
<td>4</td>
<td>MANPREET KAUR</td>
<td>AMRIK SINGH</td>
<td>08</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>5</td>
<td>5</td>
<td>KARAMJIT SINGH</td>
<td>JASWINDER SINGH</td>
<td>08</td>
<td>p</td>
<td></td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>6</td>
<td>6</td>
<td>RAJWINDER KAUR</td>
<td>JASWINDER SINGH</td>
<td>12</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>7</td>
<td>7</td>
<td>HARPREET KAUR</td>
<td>JASWINDER SINGH</td>
<td>14</td>
<td>p</td>
<td>p</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
Screenshot_2.png
[Thumbnail for Screenshot_2.png]
output
 
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly are you trying to achieve?
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@ swastik


when i select any option like kirtan or speech then ,in a table after age only show d selected option detail nt all
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looks doable but probably time taking.
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
how


plez gv me a hint
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you probably have to use style.display.
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
try this code, it will show or hide the header (not data) based on selection. Based on the same strategy you may to hide or show the related rows.
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thankqq i tried uor code
sorry bt nt wrking properly
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have already replied see that.
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Change the java script function with this one, it will give a better output.

 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry there was an error, try this.

 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
nthg happd just shrink d fields
Screenshot_3.png
[Thumbnail for Screenshot_3.png]
output
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Try the last js function.
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my output
myoutput.png
[Thumbnail for myoutput.png]
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
select other optn nd see
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes why not.

myoutput1.png
[Thumbnail for myoutput1.png]
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are probably not updating the code properly. I am pasting the complete code once again.
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
it would be like ...
Screenshot_4.png
[Thumbnail for Screenshot_4.png]
out1
Screenshot_5.png
[Thumbnail for Screenshot_5.png]
out2
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess that is what I am getting , when i click on first option it shows only the first option in the header, when I click 2nd option it shows only the 2nd option of course not the data part, but at least the header part. For the data part you need to code it accordingly.
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
no wrked .it only srnk...see if you slect other opn is there any chan cm in rollno, name or father name.................i told you noooooooooooooooooo
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
ys you are rt thankq for hlp
 
sheekha sharma
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i think i hv to rewrite d code ..i appriciate uor hlp thanq once again.........
 
Swastik Dey
Bartender
Posts: 2270
20
Android Java ME Eclipse IDE Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let me know if you need any help.
 
Every snowflake is perfect and unique. And every snowflake contains a very tiny ad.
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic