By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,238 Members | 1,657 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,238 IT Pros & Developers. It's quick & easy.

onChange function is not working

P: 2
Php code:

Expand|Select|Wrap|Line Numbers
  1. $option_value='<select name="emaillist"  class="selectmenu" onChange="getmail(this.value);"><option value="">Select</option>';
  2.  
  3. if($count >0)
  4. {
  5.     for($i=0;$i<=$count-1;$i++)
  6.     {
  7.         $option_value.='<option value='.$emails[$i].'>'.$emails[$i].'</option>';
  8.     }
  9.     //$option_value.='<option value="0">-Select all-</option>';
  10. }
  11. else
  12. {
  13.     $option_value.='<option value="">------No email found-----</option>';
  14. }
  15.  
  16.  $option_value.='</select>';
  17.  
Javascript Code:

Expand|Select|Wrap|Line Numbers
  1.  function getmail(id)
  2.    {
  3.  
  4.        alert(id);
  5.    }
Here onChange funtion is not working..plz help me
Jan 27 '12 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
Post the generated HTML code (view source in the browser).
Jan 27 '12 #2

P: 2
Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Backend Management System (Version 1.0)</title>
  6. <link href="css/backend_management_system.css" rel="stylesheet" type="text/css" />
  7. <link href="css/form.css" rel="stylesheet" type="text/css" />
  8. <link href="css/dropdown.css" media="screen" rel="stylesheet" type="text/css" />
  9. <link href="css/default.advanced.css" media="screen" rel="stylesheet" type="text/css" />
  10.  
  11.  
  12. <!--<script type="text/javascript" language="JavaScript1.2" src="nav/stmenu.js"></script>-->
  13.  
  14.  
  15. <script type="text/javascript" src="validation/config.js"></script>
  16.  
  17. <script type="text/javascript" src="validation/dFilter.js"></script>
  18. <script type="text/javascript" src="validation/dFilteralpha.js"></script>
  19. <script type="text/javascript" src="validation/error_en.js"></script>
  20. <script type="text/javascript" src="validation/FormChek.js"></script>
  21. <script type="text/javascript" src="validation/validate.js"></script>
  22. <script type="text/javascript" src="validation/submitvalidate.js"></script>
  23. <script type="text/javascript" src="js/delete_all.js"></script>
  24.  
  25.  
  26.  
  27. </head>
  28.  
  29. <body>
  30. <div id="mainDiv">
  31.   <div id="topbannerBg"><a href="home.php"><img src="http://bytes.com/topic/javascript/manage/images/bannerbg.png" width="188" height="82" id="logo_2"  /></a><p>MITHILA-HATT ADMIN BACKEND</p>
  32.     <div class="menupanel" ><div align="right" style="padding-right:35px">
  33.  
  34.     <!--<script type="text/javascript" language="JavaScript1.2" src="nav/menu.js"></script>-->
  35.     <ul class="dropdown dropdown-horizontal">
  36.     <li><a href="home.php" >Home</a>
  37.  
  38.  
  39.     </li>
  40.     <li><a href="#">Manage Categories </a>
  41.     <ul>
  42.             <li><a href="manage_mithila_pothi.php">Manage Mithila Pothi </a></li>
  43.             <li><a href="manage_mithila_kala.php">Manage Mithila Kala </a></li>
  44.             <li><a href="manage_mithila_sanskar_samagri.php">Manage Mithila Sanskar Samagri </a></li>
  45.             <li><a href="manage_mithila_video.php">Manage Mithila Audio Video </a></li>
  46.  
  47.             <li><a href="manage_mithila_aahar.php">Manage Mithila Aahar </a></li></ul>
  48.  
  49.  
  50.  
  51.     </li>
  52.     <li><a href="#" >Manage Products</a>
  53.         <ul>
  54.             <li><a href="manage_pothi_product.php">Manage Pothi Products</a></li>
  55.             <li><a href="manage_kala_product.php">Manage Kala Products</a></li>
  56.             <li><a href="manage_sanskar_samagri_product.php">Manage Sanskar Samagri Products</a></li>
  57.  
  58.             <li><a href="manage_video_product.php">Manage Video Products</a></li>
  59.             <li><a href="manage_aahar_product.php">Manage Aahar Products</a></li>
  60.             </ul>
  61.     </li>
  62.     <li><a href="#" >User Management</a>
  63.         <ul>
  64.             <li><a href="manage_admin_users.php">Manage Admin User</a></li>
  65.  
  66.             <li><a href="manage_website_users.php">Manage Website User</a></li>
  67.             <li><a href="manage_invited_user.php">Manage Invite User</a></li>
  68.                     </ul>
  69.     </li>
  70.     <li><a href="#" >Contact User</a>
  71.         <ul>
  72.             <li><a href="manage_contact_us.php">Manage Contacts</a></li>
  73.  
  74.             <li><a href="send_newsletter.php">Send News letter</a></li>
  75.             <li><a href="#">Manage Testimonials</a></li>
  76.             </ul>
  77.     </li>
  78.     <li><a href="logout.php" >Logout</a></li>
  79.  
  80. </ul>
  81.  
  82.     </div></div>
  83.  
  84.   </div>
  85.   <div id="leftshadowDiv">
  86.   <div id="rightshadowDiv">
  87.   <div style="min-height:480px;">
  88.       <!---<script type="text/javascript" src="ckeditor/ckeditor.js"></script>-->
  89.   <script type="text/javascript" src="js/email.js"></script>
  90.   <div style="padding-top:30px;"></div>
  91.  
  92.    <fieldset class="fildsetadmin">
  93.  
  94.    <legend>Invite Users </legend>
  95.       <form name="form1" id="form1" method="post"  appenddiv="errs"  action="" enctype="multipart/form-data" class="myform">
  96.  
  97. <table width="100%" cellpadding="4" cellspacing="4" border="0">
  98. <tr><td>&nbsp;</td>
  99.   <td>&nbsp;</td>
  100.   <td align="right"><a href="home.php"><img src="http://bytes.com/images/backtocontrolpanel.png" width="152" height="23" border="0" /></a></td>
  101. </tr>
  102. <tr>
  103.   <td colspan="3"></td>
  104.   </tr>
  105.  
  106. <tr >
  107.         <td width="269"  nowrap="nowrap" style="text-align:right" class="labeltext">User Email Address   <span style="color:#FF0000">*</span></td>
  108.         <td width="132"  nowrap="nowrap" style="text-align:left">
  109.         <!--<select name="emaillist">-->
  110.                             <select name="emaillist"  class="selectmenu" onChange="getmail(this.value);"><option value="">Select</option><option value=99@gmail.com>99@gmail.com</option><option value=sonu@gmail.com>sonu@gmail.com</option><option value=sonu12@gmail.com>sonu12@gmail.com</option><option value=son12112@gmail.com>son12112@gmail.com</option><option value=45452@gmail.com>45452@gmail.com</option><option value=1212@gmail.com>1212@gmail.com</option><option value=1212152@gmail.com>1212152@gmail.com</option><option value=1252@gmail.com>1252@gmail.com</option><option value=fe@gmail.com>fe@gmail.com</option><option value=sw@gmail.com>sw@gmail.com</option><option value=154f@g.com>154f@g.com</option><option value=s12@gmail.com>s12@gmail.com</option><option value=debupappu81@gmail.com>debupappu81@gmail.com</option><option value=manirul2009@gmail.com>manirul2009@gmail.com</option><option value=mani@gmail.com>mani@gmail.com</option><option value=amrit@gmail.com>amrit@gmail.com</option><option value=j12@gmail.com>j12@gmail.com</option><option value=subhodeep.majumder@gmail.com>subhodeep.majumder@gmail.com</option><option value=sayangoswami2008@gmail.com>sayangoswami2008@gmail.com</option></select>
  111.  
  112.         <!--</select>-->
  113.  
  114.         </td>
  115.         <td width="788"    class="rules" id ="emailmsg">&nbsp;</td>
  116. </tr>
  117.  
  118.  
  119.  
  120. <tr >
  121.         <td width="269"  nowrap="nowrap" style="text-align:right" class="labeltext">Message  <span style="color:#FF0000">*</span></td>
  122.         <td colspan="2"  nowrap="nowrap" style="text-align:left"><textarea cols="50" rows="8" message="messagemsg"  name="message" id="message" required=""  exception=""  validate="Whitespace"  unique="false"></textarea>
  123.  
  124.      <!-- <script type="text/javascript">
  125.  
  126.                     CKEDITOR.replace('message');
  127.  
  128.                 </script>--></td>
  129.     </tr>
  130.  
  131.  
  132.  
  133. <tr >
  134.        <td  style="text-align:center;" >&nbsp;</td>
  135.        <td align="left"  style="text-align:left;" ><input type="submit" name="Submit" value="Submit" tabindex="9"  class="button"/>
  136.          <input name="reset" type="reset" value="Reset"  class="button" /></td>
  137.        <td>&nbsp;</td>
  138. </tr>
  139.  
  140.  
  141.  
  142.  
  143.  
  144. <tr >
  145.   <td  style="text-align:center;" >&nbsp;</td>
  146.   <td align="left"  style="text-align:left;" >&nbsp;</td>
  147.   <td>&nbsp;</td>
  148. </tr>
  149. <tr >
  150.   <td  style="text-align:center;" >&nbsp;</td>
  151.   <td align="left"  style="text-align:left;" >&nbsp;</td>
  152.  
  153.   <td>&nbsp;</td>
  154. </tr>
  155. </table>
  156.  
  157. </form>
  158.  
  159.       </fieldset>
  160.    </div> 
  161.   </div></div>
  162.  
  163.   <div id="footer" align="center">Copyright &copy; 2010 www.mithilahaat.com. All Rights Reserved. Powered  By <a href="http://www.smait.com" target="_blank">Smait.com</a>, India<br />
  164.  
  165.   </div>
  166. </div>
  167. </body>
  168. </html>
Jan 30 '12 #3

acoder
Expert Mod 15k+
P: 16,027
Wrap your values in quotes, i.e.
Expand|Select|Wrap|Line Numbers
  1. <option value="something">something</option>
Jan 30 '12 #4

Post your reply

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