473,320 Members | 1,572 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,320 software developers and data experts.

display data from data base when onchange in drow down

i have html page and two drop down when i change value in service drop down the value changed in anothed drop down

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE HTML>
  2.  
  3. <html>
  4. <head>
  5.  
  6.     <title>Gestion Des Non-Conformité</title>
  7.     <link rel="stylesheet" href="css/style.css"/>
  8.    <!-- <script type="text/javascript" src="chemindiv.js">
  9. </script>-->
  10.      <script type="text/javascript" src="JScript_1.11.js"></script>    
  11.      <script type="text/javascript" src="Copie (2) de jvc.js"></script>
  12.  
  13. <style type="text/css">
  14.    h3{font-family: Calibri; font-size: 22pt; font-style: normal; font-weight: bold; color:SlateBlue;
  15. text-align: center; text-decoration: underline }
  16.  
  17. table{font-family: Calibri; color:white; font-size: 11pt; font-style: normal;
  18.  background-color: #4c8f97; border: 5px solid #1c2137}
  19.  
  20. table.inner{border: 0px}
  21. </style>
  22.  
  23.  
  24.  
  25. <script type="text/javascript" src="jquery-1.7.2.min.js"></script>
  26.  
  27. <script>
  28.     function Submitt(){
  29.         document.getElementById("allserivce").submit();
  30.     }
  31. </script>
  32.  
  33.  
  34. <!-- <script type="text/javascript">
  35.  
  36.      $.get('Copie de selectemployee_par_service.asp', function (data) {
  37.          $('#allserivce').html(data);
  38.      });
  39.  
  40. </script>-->
  41.  
  42. </head>
  43.  
  44.  
  45.  
  46. <body >
  47.     <div id="body">
  48.  
  49.  
  50.                  <h3>identification de non-conformite</h3>
  51.  
  52. <form action="Employee.asp" method="POST">
  53.  
  54. <table align="center" cellpadding = "10" >
  55.  
  56. <!----- N dossie ---------------------------------------------------------->
  57. <tr>
  58. <td>N Dossier</td>
  59. <td><input type="text" name="First_Name" maxlength="30" id="autree" onclick="check();" />
  60. </td>
  61. </tr>
  62.  
  63.  <!----- test ---------------------------------------------------------->
  64.  <tr>
  65.  
  66. <td>Service </td>
  67. <td><select  onchange="this.form.submit();Loaddd('Employee.asp','nservicee');" name="comboser" id="allserivce">
  68.  
  69. </select></td>
  70. </tr>
  71.  
  72. <!----- choix service ---------------------------------------------------------->
  73.  
  74. <tr>
  75.   <td>Choix</td> 
  76.   <td><select id="nservicee">
  77.  
  78.   </select></td>   
  79. </tr>
  80.  
  81. <!----- nature ---------------------------------------------------------->
  82. <tr>
  83. <td>Nature</td>
  84. <td><input type="text" name="Last_Name" maxlength="30"/>
  85. </td>
  86. </tr>
  87.  <!-----delai---------------------------------------------------------->
  88. <tr>
  89. <td>Delai</td>
  90. <td><input type="text" name="Email_Id" maxlength="100" /></td>
  91. </tr>
  92. <!----- Processus-------------------------------------------------------->
  93. <tr>
  94. <td>Processus</td>
  95. <td>
  96. <select name="Birthday_day" id="Birthday_Day">
  97. <option value="1">Processus 1</option>
  98. <option value="2">Processus 2</option>
  99. <option value="3">Processus 3</option>
  100. <option value="4">Processus 4</option>
  101. </select>
  102.  </td>
  103.  </tr>
  104.  <!----- Activite-------------------------------------------------------->
  105.  <tr>
  106.  <td>Activite</td>
  107.  
  108.  <td>
  109. <select id="Birthday_Month" name="Birthday_Month">
  110. <option value="October">Activite 1</option>
  111. <option value="November">Activite 2</option>
  112. <option value="December">Activite 3</option>
  113. </select>
  114.  </td>
  115.  </tr>
  116.  <!----- AC et AP-------------------------------------------------------->
  117.  <tr>
  118.  <td>AC et AP</td>
  119.  
  120.  <td>
  121. <select name="Birthday_Year" id="Birthday_Year">
  122. <option value="oui">Oui</option>
  123. <option value="non">non</option>
  124. </select>
  125. </td>
  126. </tr>
  127.  
  128.  <tr>
  129. <td colspan="2" align="center">
  130. <input type="button" value="Submit"/>
  131. <input type="reset" value="Reset"/>
  132. </td>
  133. </tr>
  134.  
  135. </table>
  136.  
  137. </form>
  138.     </div>
  139.  
  140.  
  141. </body>
  142. </html>
  143.  
  144.  
  145.  
  146. asp page 
  147.  
  148.  <%@ LANGUAGE="VBSCRIPT" %>
  149. <!-- #include file="Connect.inc" -->
  150.  
  151.  <%
  152.  
  153.                 strconnexion = connectionstr
  154.                 Dim Connection
  155.                 Dim Recordse
  156.                 Dim Recordse1
  157.                 Dim Recordse2
  158.                 Dim sql
  159.                 Dim sql1
  160.                 Dim sql2
  161.                 Dim serrr
  162.                 serrr="CT"
  163.  
  164.  
  165.  
  166.  
  167.                 sql1= "SELECT * FROM Servicee where Libelle_service='"& Request.Form("comboser") &"'"
  168.                 Set Connection = Server.CreateObject("ADODB.Connection")
  169.                 Set Recordse1 = Server.CreateObject("ADODB.Recordset")
  170.  
  171.                 Connection.Open strconnexion
  172.                 Recordse1.Open sql1,Connection
  173.  
  174.                 if Recordse1("ID_service") = 2 then 
  175.  
  176.  
  177.                        sql="select * from Employee where Employee.ID_service="& Recordse1("ID_service") &" and ID_profile=2 "               
  178.                        Set Recordse = Server.CreateObject("ADODB.Recordset")
  179.                        Recordse.Open sql,Connection
  180.                        Response.Write("<select>")
  181.                            If Recordse1.EOF Then
  182.                                 Response.Write("<option>Aucune Employee</option>")
  183.                           else
  184.                                   Do While NOT Recordse.Eof 
  185.                                   Response.Write("<option>"& Recordse("Nom_emp")+" "+ Recordse("Prenom_emp") &"</option>")
  186.                                   Recordse.MoveNext
  187.                                   loop
  188.                          end If
  189.                          Response.Write("</select>")
  190.              '   else
  191.  
  192.               '      sql2 = "select * from Employee where ID_service ="& Recordse1("ID_service") &""
  193.                '     Recordse2.Open sql2,Connection
  194.                 '         If Recordse2.EOF Then
  195.                  '              Response.Write("<option>Aucune Employee</option>")
  196.                   '       else
  197.                    '            Do While NOT Recordse2.Eof 
  198.  
  199.                     '           Response.Write("<option>"& Recordse2("Nom_emp")& "</option>")
  200.  
  201.  
  202.                      '          Recordse2.MoveNext
  203.                       '         loop
  204.                        ' end If
  205.                  end If
  206.  
  207.  
  208.  
  209.                 Recordse.Close
  210.                 Set Recordse=nothing
  211.                 Recordse1.Close
  212.                 Set Recordse1=nothing
  213.                 Connection.Close
  214.                 Set Connection=nothing
  215.  
  216.               %>
Apr 22 '14 #1
0 1247

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

Similar topics

0
by: serge calderara | last post by:
Dear all, I need to display in my application incoming data from an external source which is pooled every 2 seconds. Thos data actually are displaye in a listbox control, but the problem I...
1
by: Jason Chan | last post by:
Some chinese characters data (in Big5 encoding) is stored in database. I tried to display the data in an aspx but the characters cannot display correctly. I tried anything I think is related: -...
0
by: teknowledgy | last post by:
My SQL database has four tables. A couple of the columns in these tables use the xml data type which receive data from custom asp.net 2.0 user controls. Now I am trying to display the data from my...
1
by: mviz | last post by:
I have a RS dataset that contains XML data, but when this data is displayed on the browser it shows as a string. I need help to display this data as a formatted XML document in browser. I have...
1
by: umeshdchaudhari | last post by:
fist I filled value of drow down and GridView control. Now we find the databound of grid view control as per drow down value at time binding. ? How we find the value of control time of binding in...
2
by: giandeo | last post by:
Hello all, It's almost a couple of weeks since i am struggling to get this code work. Unfortunately, i am stuck. There seems to be no hope... Please Help....... I am working with an asp page...
19
by: Mel | last post by:
I want to display custom data in some sort of control on a web page. By custom data I mean it's not in a database yet it just resides in a List Box on a different tab . I just want to display the...
2
by: matamala Naresh | last post by:
in the table 3 fields are available (id,name,dept) iam creating drop down list with names.when user selects name in the drop down we need to auto pop up the department(dept) of that selected name in...
1
by: hrushikeshd | last post by:
I want to display my data in rich-text box in the tree like structure,i fetch the data from the data base MSACCESS & i want to print it on my rich-textbox, what can i do ? exampale is :-A ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.