Related to give me in javascript or other programming language

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dhrupal
    New Member
    • Nov 2009
    • 2

    Related to give me in javascript or other programming language

    Respected Sir,
    I am new in java i sending you a source file please make its html site and see.
    My question is that its a very big table so at above in this table i make different icon so how can i connect this icon with this table so by entering the detail in icon i can see only this much table. For example in this icon i enter only H K Pathak so i can see the detail in the table related to only H K Pathak.
    Here i attech the text document please convert in thml file and just see.
    So please give me such type of javascript or any programm.
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Yep, you can very well do that. I am attaching a Sample with this... I am not sure wether you are looking for this one. Have a look over that.. Please post back if you have any doubts on that one.

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> New Document </TITLE>
    <META NAME="Generator" CONTENT="EditPlus">
    <META NAME="Author" CONTENT="">
    <META NAME="Keywords" CONTENT="">
    <META NAME="Description" CONTENT="">
    <script type="text/javascript">
    	function doThis()
    	{
    		var xx= document.getElementById('mySelect').selectedIndex;
    		if(xx=="1")
    		{
    			document.getElementById('1').style.display='block';
    			document.getElementById('2').style.display='none';
    			document.getElementById('3').style.display='none';
    		}
    		else if(xx=="2")
    		{
    			document.getElementById('1').style.display='none';
    			document.getElementById('2').style.display='block';
    			document.getElementById('3').style.display='none';
    		}
    		else if(xx=="3")
    		{
    			document.getElementById('1').style.display='none';
    			document.getElementById('2').style.display='none';
    			document.getElementById('3').style.display='block';
    		}
    		else
    		{
    			document.getElementById('1').style.display='none';
    			document.getElementById('2').style.display='none';
    			document.getElementById('3').style.display='none';
    		}
    		 
    	}
    </script>
    </HEAD>
    
    <BODY>
    <select id="mySelect" name="mySelect" onchange="doThis()">
    <option value="0">Select</option>
    <option value="1">Rahman</option>
    <option value="2">Manirathnam</option>
    <option value="3">Tom Cruise</option>
    </select>
    <table>
    <tr id="1" style="display:none;">
    <td><center>1</center></td>
    <td><center>----</center></td>
    <td><center>----</center></td>
    <td><center>L</center></td>
    <td><center>EP</center></td>
    <td><center><A href="nt.html.doc">H.A.Pahtak</A></center></td>
    <td><center>Filing cabinet and storwel</center></td>
    <td><center>As per spec</center></td>
    <td><center>IPR/SST/OA/003/1996-97</center></td>
    <td><center>16/07/1996</center></td>
    <td><center>48,810.70</center></td>
    <td><center>M/s. Godrej & Boyce <br>MFG.CO.LTD.</center></td>
    </tr>
    <tr id="2" style="display:none;">
    <td><center>2</center></td>
    <td><center>----</center></td>
    <td><center>----</center></td>
    <td><center>F</center></td>
    <td><center>EP</center></td>
    <td><center>H.A.Pathak</center></td>
    <td><center>120 m3/hr rotary pump</center></td>
    <td><center>04 nos.</center></td>
    <td><center>IPR/SST/F/020/1996-97</center></td>
    <td><center>16/09/1996</center></td>
    <td><center>FF 22,5000.00</center></td>
    <td><center>M/s.Alcatel Vacuum GmbH</center></td>
    </tr>
    <tr id="3" style="display:none;">
    <td><center>3<center></td>
    <td><center>----<center></td>
    <td><center>----<center></td>
    <td><center>F<center></td>
    <td><center>EP<center></td>
    <td><center>H.A.Pathak<center></td>
    <td><center>5000 1/s TMP<center></td>
    <td><center>08 nos.<center></td>
    <td><center>IPR/SST/F/031/1996-97<center></td>
    <td><center>07/11/1996<center></td>
    <td><center>DM 6,64,512.00<center></td>
    <td><center>M/s.Pfeiffer Vacuum GmbH<center></td>
    </tr>
    </table>
    </BODY>
    </HTML>
    Thanks and Regards
    Ramanan Kalirajan

    Comment

    • Dormilich
      Recognized Expert Expert
      • Aug 2008
      • 8694

      #3
      Originally posted by RamananKaliraja n
      Code:
      	function doThis()
      	{
      		var xx= document.getElementById('mySelect').selectedIndex;
      		if(xx=="1")
      		{
      			document.getElementById('1').style.display='block';
      			document.getElementById('2').style.display='none';
      			document.getElementById('3').style.display='none';
      		}
      1. why not using the select’s value directly?
        Code:
        var xx = this.value;
      2. IDs must never ever start with a number (see ID constraints, resp. the Name type definition (use the link))
      3. <center> is not necessary, a simple CSS line can do the same (and saves you quite some transfer volume)
        Code:
        td { text-align: center; }

      Comment

      • RamananKalirajan
        Contributor
        • Mar 2008
        • 608

        #4
        @ Dormilich, I have learnt a thing which I dont know till now.. I wont start the Id with a number. Thanks man...

        Thanks and Regards
        Ramanan Kalirajan

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          Originally posted by RamananKaliraja n
          I have learnt a thing which I dont know till now..
          wait ’til you use XHTML. you’ll be prompted with every XML error that occurs.

          Comment

          • dhrupal
            New Member
            • Nov 2009
            • 2

            #6
            Thank You Very much Sir

            Comment

            Working...