473,499 Members | 1,548 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

ajax not working in mozilla please help me i am posting my code here please see

1 New Member
Expand|Select|Wrap|Line Numbers
  1. <%@ page import="java.sql.*"%>
  2. <jsp:include page="home.jsp" />
  3.   <div style="left:200;top:0;height:100%;width:800;background-color:#d6d6d6;position:absolute">
  4. <HTML>
  5.  <HEAD>
  6.   <TITLE> Add B.Tech Project Details </TITLE>
  7.   <META NAME="Generator" CONTENT="EditPlus">
  8.   <META NAME="Author" CONTENT="">
  9.   <META NAME="Keywords" CONTENT="">
  10.   <META NAME="Description" CONTENT="">
  11.   <style>
  12.   TD
  13. {
  14.     FONT-WEIGHT: bold;
  15. }
  16. </style>
  17.  
  18. <!-- calendar stylesheet -->
  19.   <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-cold-1.css" title="win2k-cold-1" />
  20.  
  21.   <!-- main calendar program -->
  22.   <script type="text/javascript" src="calendar.js"></script>
  23.  
  24.   <!-- language for the calendar -->
  25.   <script type="text/javascript" src="calendar-en.js"></script>
  26.  
  27.   <!-- the following script defines the Calendar.setup helper function, which makes
  28.        adding a calendar a matter of 1 or 2 lines of code. -->
  29.   <script type="text/javascript" src="calendar-setup.js"></script>
  30. <script type="text/javascript" language="javascript">
  31.  
  32. function show()
  33. {
  34. if(""==document.forms.contact.college.value)
  35.     {
  36. document.getElementById("1").style.visibility="visible";
  37. return false;
  38.     }
  39. if(""==document.forms.contact.code.value)
  40.     {
  41.     document.getElementById("2").style.visibility="visible";
  42. return false;
  43.     }
  44. if(""==document.forms.contact.place.value)
  45.     {
  46.     document.getElementById("3").style.visibility="visible";
  47.     return false;
  48.     }
  49. if(""==document.forms.contact.login.value)
  50.     {
  51.     document.getElementById("4").style.visibility="visible";
  52.     return false;
  53.     }
  54. if(""==document.forms.contact.pass.value)
  55.     {
  56.     document.getElementById("5").style.visibility="visible";
  57.     return false;
  58.     }
  59. }
  60.  
  61. function reset1()
  62. {
  63. if(""==document.forms.contact.college.value)
  64. document.getElementById("1").style.visibility="visible";
  65. else
  66. document.getElementById("1").style.visibility="hidden";
  67. if(""==document.forms.contact.code.value)
  68. document.getElementById("2").style.visibility="visible";
  69. else
  70. document.getElementById("2").style.visibility="hidden";
  71. if(""==document.forms.contact.place.value)
  72. document.getElementById("3").style.visibility="visible";
  73. else
  74. document.getElementById("3").style.visibility="hidden";
  75. if(""==document.forms.contact.login.value)
  76. document.getElementById("4").style.visibility="visible";
  77. else
  78. document.getElementById("4").style.visibility="hidden";
  79. if(""==document.forms.contact.pass.value)
  80. document.getElementById("5").style.visibility="visible";
  81. else
  82. document.getElementById("5").style.visibility="hidden";
  83. var emptyRow=null;
  84.   function init() {
  85.     var table = document.getElementById( 'insert' );
  86.     var tbody = table.getElementsByTagName( 'TBODY' )[ 0 ];
  87.     var tr    = tbody.firstChild;
  88.     while ( tr && tr.nodeName != 'TR' ) {
  89.       tr = tr.nextSibling;
  90.     }
  91.     emptyRow = tr.cloneNode( true );
  92.   }
  93.   function AddRow() {
  94.     var table = document.getElementById( 'insert' );
  95.     var tbody = table.getElementsByTagName( 'TBODY' )[ 0 ];
  96.     var numRows = tbody.rows.length;
  97.     if(numRows >12)return false;
  98.     var where   = tbody.rows[ numRows - 1 ];
  99.     var newRow  = emptyRow.cloneNode( true );
  100.     for(var i=0; i<tbody.rows.length; i++)
  101.     {
  102.         var new_name = "l2pn";
  103.         for(var j=0; j<tbody.rows[i].childNodes.length; j++)
  104.         {
  105.             alert(">>"+tbody.rows[i].childNodes[j].getAttribute("Name")+">>");
  106.         }    
  107.  
  108.     }
  109.     insertAfter( where, newRow, numRows );
  110.   }
  111.   function insertAfter( here, newNode, numRows)
  112.   {
  113.     here.parentNode.insertBefore( newNode, here.nextSibling );
  114.     var newNode_name = '';
  115.   }
  116. </script>
  117. </HEAD>
  118.  <body onload='init()' bgcolor="d6d6d6" >
  119.   <%
  120. try
  121. {
  122. Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
  123. Connection con=DriverManager.getConnection("jdbc:odbc:Driver={Oracle in XE}","system","charanteja");
  124. String code=(String)session.getAttribute("user1");
  125. PreparedStatement st=con.prepareStatement("select count(*) from revenue where staff_id=?");
  126. st.setString(1,code);
  127. ResultSet rs=st.executeQuery();
  128. rs.next();
  129. int sno=Integer.parseInt(rs.getString(1));
  130. %>
  131.  
  132.  <center>
  133.  <div id ="a"  ></div>
  134.  </center>
  135.  <FORM  METHOD=POST  action="./btechnext.jsp"   onSubmit="return show(contact)" align="center"  name="contact">
  136. <div id="divarea" style="visibility:hidden;color:green;size:18px" align="center"><b>B.Tech Project details added successfully</b></div>
  137. <b style="color:green;size:18px"><center>Add Details of B.Tech Projects</center></b><br><br>
  138. <table align="center">
  139. <tr width="400">
  140. <td align="left">S.No</td>
  141. <td align="right"><INPUT TYPE="text"  NAME="sno4" readonly="readonly" value="<%=sno+1%>"></td></tr>
  142. <tr><td align="left">Title</td>
  143. <td align="right" ><INPUT TYPE="text"  NAME="tit" onchange="reset1()"></td></tr>
  144. <tr><td align="left">Area</td>
  145. <td align="right" ><INPUT TYPE="text"  NAME="area" onchange="reset1()"></td></tr>
  146. <tr><td align="left">Hours Spent/Week</td>
  147. <td align="right" ><INPUT TYPE="text"  NAME="hpw1" onchange="reset1()"></td></tr>
  148. <tr><td align="left">Total Hours</td>
  149. <td align="right" ><INPUT TYPE="text"  NAME="th1" onchange="reset1()"></td></tr>
  150. <tr>
  151.     <td align="left" >From Date</td>
  152. <td >
  153. <input align="right" type="text" name="date1" id="date1"  tabindex="6"></td>
  154. <td width="22"><img border="0" src="calendar.gif" id="f_trigger_c1" style="cursor: pointer; border: 1px solid red;" onmouseover="this.style.background='red';" onMouseOut="this.style.background=''" width="20" height="14" /></td> 
  155. <script type="text/javascript">
  156.                     Calendar.setup({
  157.                         inputField     :    "date1",     // id of the input field
  158.                         ifFormat       :    "%d/%m/%Y",      // format of the input field
  159.                         button         :    "f_trigger_c1",  // trigger for the calendar (button ID)
  160.                         align          :    "Tl",           // alignment (defaults to "Bl")
  161.                         singleClick    :    true
  162.                     });
  163.                 </script>
  164.  
  165. </tr>
  166.  
  167.  
  168. <tr>
  169.     <td align="left">To Date</td>
  170. <td ><acronym  title="Enter the Expected date of completion in case of ongoing projects">
  171. <input align="right" type="text" name="date2" id="date2"  tabindex="7"> </acronym></td>
  172. <td width="22">
  173. <img border="0" src="calendar.gif" id="f_trigger_c2" style="cursor: pointer; border: 1px solid red;" onmouseover="this.style.background='red';" onMouseOut="this.style.background=''" width="20" height="14" /></td>
  174.  <script type="text/javascript">
  175.                     Calendar.setup({
  176.                         inputField     :    "date2",     // id of the input field
  177.                         ifFormat       :    "%d/%m/%Y",      // format of the input field
  178.                         button         :    "f_trigger_c2",  // trigger for the calendar (button ID)
  179.                         align          :    "Tl",           // alignment (defaults to "Bl")
  180.                         singleClick    :    true
  181.                     });
  182.                 </script> 
  183.  
  184.  
  185. </tr>
  186. </table>
  187. <table align="center"" id="insert" > 
  188. <thead>
  189. <tr>
  190. <th align="left" >Student Name</th>
  191. <th align="right">Roll Number</th>
  192. </tr>
  193. </thead>
  194. <tbody>
  195. <tr>
  196. <th align="left" width="40"><INPUT TYPE="text" NAME="n1" onchange="reset1()"></th>
  197. <th align="right" width="40"><INPUT TYPE="text" NAME="r1" onchange="reset1()"></th>
  198. </tr>
  199. </tbody>
  200. </table>
  201. <table align="center"><th> </th>
  202. <th align="right"><input type='button' value='Add Student' onclick='AddRow()'></th></table>
  203. <center><br>
  204. <INPUT TYPE="submit"  value="Save" onclick="show()" onclick="show()">
  205. <INPUT TYPE="Reset"  value="Reset">
  206. </center>
  207. <br/>
  208. <table align="center">
  209. <tr>
  210. <td>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="viewmtech.jsp" style="color:green"><u>View M.Tech Projects Details</u> </a></td>
  211. </tr>
  212. </table>
  213.  </FORM>
  214. </div>
  215. <%
  216.  
  217. con.close();
  218. }
  219. catch(Exception e)
  220. {
  221.  
  222.         out.println(e);
  223. }
  224. %>
  225. </BODY>
  226. </HTML>
Aug 12 '10 #1
1 1435
Dormilich
8,658 Recognized Expert Moderator Expert
1) I can’t see any AJAX code (probably in the external JS files)
2) you’re missing the DTD
3) line #3 is to be removed
Aug 12 '10 #2

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

Similar topics

0
1509
by: collie | last post by:
Hi, I have an asp page that needs to create 2 different cookies: one for the admin and one for the user. The code that I have to work with was created by someone else. the page first requires to...
7
3569
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
2
3193
by: PC User | last post by:
I found some VB code to printout a richtext field and I'm trying to adapt it to MS Access 2000. I think there might be some small changes to make the adaption between VB versions. Also my OS is...
29
2055
by: Gernot Frisch | last post by:
Hi, I have no clue. - I want to align the red, green, blue boxes in one line - red,green,blue must be 45px high - red (center) must be as wide as possible - yellow must start exactly below...
1
19228
Banfa
by: Banfa | last post by:
POSTING GUIDELINES Please follow these guidelines when posting questions. Submitting clear and concise questions allows those reading to understand your problem and respond easily. Post your...
6
1624
by: Marc | last post by:
Hi, I am using the below code which simply allows a single button control to be dragged and dropped anywhere around a form. My problem is that want to move about 100 buttons on the form. Is...
3
1297
by: MrHelpMe | last post by:
Hello experts and thanks so much for having a look at this. I have the following peice of code that I am stumped on. <table width="90%" cellpadding=0 align="center"> <tr> <td...
1
1234
by: MichiganMan | last post by:
I have to do a simple temp conversion page in Javascript. I wrote code that I thought was right, but it is not showing output after I click the calculate button. Could someone PLEASE tell me what I...
8
1230
by: Andy B | last post by:
Before I do a no no on a newsgroup, I need to ask a question: What is the max number of lines of code you can/should post here before it gets too long?
0
7126
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7005
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7168
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7210
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6891
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5465
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4916
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
3087
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
293
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.