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

form doesnt show

100+
P: 232
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.     session_start();   
  3.  
  4. ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8.    <title></title>
  9.    <meta name="generator" content="Microsoft FrontPage 5.0" />
  10.    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  11.    <meta name="description" content="" />
  12.    <meta name="keywords" content="" />
  13.    <meta name="author" content="" />
  14. <script languphase="javascript" type="text/javascript">
  15. var xmlhttp;
  16.  
  17. function showUser(str)
  18. {
  19. xmlhttp=GetXmlHttpObject();
  20. if (xmlhttp==null)
  21.   {
  22.   alert ("Browser does not support HTTP Request");
  23.   return;
  24.   }
  25. var url="rteg.php";
  26. url=url+"?q="+str;
  27. url=url+"&sid="+Math.random();
  28. xmlhttp.onreadystatechange=stateChanged;
  29. xmlhttp.open("GET",url,true);
  30. xmlhttp.send(null);
  31. }
  32.  
  33. function stateChanged()
  34. {
  35. if (xmlhttp.readyState==4)
  36. {
  37. document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
  38.  
  39. }
  40. }
  41.  
  42. function GetXmlHttpObject()
  43. {
  44. if (window.XMLHttpRequest)
  45.   {
  46.   // code for IE7+, Firefox, Chrome, Opera, Safari
  47.   return new XMLHttpRequest();
  48.   }
  49. if (window.ActiveXObject)
  50.   {
  51.   // code for IE6, IE5
  52.   return new ActiveXObject("Microsoft.XMLHTTP");
  53.   }
  54. return null;
  55. }
  56. </script>
  57. <script language="JavaScript" src="../../../include/common.js"></script>
  58.  
  59.  
  60.  
  61.  
  62. <link rel="stylesheet" href="../../../include/style.css" type="text/css" />
  63. </head>
  64. <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  65.  
  66. <div id="txtHint"> 
  67. <?php
  68. $scheme=$_GET['scheme'];
  69. //$TR_State=$_GET['TR_State'];
  70. //echo $TR_State;
  71.  
  72.  
  73. if($scheme=="")
  74.     {
  75.     echo "<meta http-equiv='refresh' content='1; url=ngo.php'>";
  76.     } 
  77. require("../include/header.php"); ?>
  78. <?php require("../include/left.php"); ?>
  79.  
  80.  
  81. <div class="heading"> </div>
  82.      <div class="text"> 
  83.     <?php 
  84.  
  85.  
  86.  
  87.  
  88.      require("../include/conn.php");
  89.      require("../include/dob.php");
  90.      require_once "../include/formvalidator.php";
  91.     //require_once "formvalidator.php";
  92.  
  93. ?>
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.       <table width="100%" align="left"  cellpadding="0" cellspacing="0">
  101.         <form action="" method="POST"  name="form1" onsubmit="return ValidateForm(this)">
  102.         some code
  103.  
  104.                               <tr valign="middle"> 
  105.             <td ><div align="left"></div></td>
  106.             <td><div align="left"></div></td>
  107.           <tr valign="middle"> 
  108.             <td > <div align="left">State</div></td>
  109.             <?php
  110. //Select a User:
  111.  
  112. $q=$_GET["q"];
  113. //echo $q;
  114. //exit;
  115. $q= mysql_real_escape_string($q);
  116. if($q=="")
  117. {
  118. $q="assam";
  119. }
  120.  
  121. $sql="SELECT distinct(state) FROM statedistrict";
  122.  
  123. $result = mysql_query($sql);
  124. ?>
  125.             <td> <div align="left"> 
  126.                 <select name="TR_State" id="TR_State" onchange="showUser(this.value)">
  127.                   <option value="<?php echo $q; ?>"><?php echo $q; ?></option>
  128.                   <?php 
  129. while($row = mysql_fetch_array($result))
  130.   {  ?>
  131.                   <option value="<?php echo $row[0]; ?>"><?php echo $row[0]; ?></option>
  132.                   <?php }
  133.  
  134.  
  135. ?>
  136.                 </select>
  137.               </div></td>
  138.           </tr>
  139.           <tr valign="middle"> 
  140.             <td ><div align="left"></div></td>
  141.             <td><div align="left"></div></td>
  142.           </tr>
  143.           <tr valign="middle"> 
  144.             <td > <div align="left">District</div></td>
  145.             <td> <div align="left"> 
  146.  
  147.  
  148.                 <select name="TR_District" id="TR_District">
  149.                   <?php
  150.  
  151.  
  152.  
  153. $sql="SELECT district FROM statedistrict WHERE state = '".$q."'";
  154. ?>
  155.  
  156. <?php
  157. $result = mysql_query($sql);
  158.  
  159.  
  160.  
  161. while($row = mysql_fetch_array($result))
  162.   {
  163.   ?>
  164.                   <option value="<?php echo $row[0]; ?>"><?php echo $row[0]; ?></option>
  165.                   <?php }
  166.  
  167.  
  168. ?>
  169.                 </select>
  170.               </div></td>
  171.           </tr>
  172.  
  173.         </form>
  174.  
  175.  
  176.       </table>
  177.  
  178.  
  179.  
  180.  
  181.    </div>
  182.  
  183. <?php require("../include/right.php"); ?><?php require("../include/footer.php"); ?>
  184. </div></div></div></div>
  185. </body>
  186. </html>
  187.  
kindly help to find the error this code is running fine with other browsers but in firefox on changing state only left right header shows but form doesnt show
Mar 2 '10 #1
Share this Question
Share on Google+
3 Replies


gits
Expert Mod 5K+
P: 5,390
what does firebug or firefox's error console say?

kind regards
Mar 2 '10 #2

100+
P: 232
it doesnt give any error but whole page comes again except form.form doesnt come on changing state
Mar 3 '10 #3

100+
P: 232
is there any thing that <div id="txtHint"> only html tag comes my form also contains some php tags
Mar 3 '10 #4

Post your reply

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