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

Javascript help

P: 1
In the following code i am facing this error:


error: "document.parameter" is null or not an objevt.


can any one help?
Thanks in advance





Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
  2. <%
  3. String path = request.getContextPath();
  4. String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
  5. %>
  6.  
  7. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  8. <html>
  9.  
  10.   <head>;
  11.     <base href="<%=basePath%>">
  12.  
  13.     <title>My JSP 'MyJsp.jsp' starting page</title>
  14.  
  15.     <meta http-equiv="pragma" content="no-cache">
  16.     <meta http-equiv="cache-control" content="no-cache">
  17.     <meta http-equiv="expires" content="0">    
  18.     <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
  19.     <meta http-equiv="description" content="This is my page">
  20.     <!--
  21.     <link rel="stylesheet" type="text/css" href="styles.css">
  22.     -->
  23.     <script>
  24.     function updateForm()
  25.     {
  26.     document.parameter.action="UpdateParameter.do?dispatch=1&lookupType=updateParameter";
  27.     document.parameter.method="post";
  28.     document.parameter.submit();
  29.     }
  30.     function addForm()
  31.     {
  32.  
  33.     document.parameter.action="UpdateParameter.do?dispatch=1&lookupType=addParameter";
  34.     document.parameter.method="post";
  35.     document.parameter.submit();
  36.     }
  37.     </script>
  38.  
  39.   </head>
  40.  
  41.   <body>
  42.  
  43.    <html:form  styleId="parameter" method="post" action="UpdateParameter.do" >
  44.  
  45.   <table>
  46.   <tr>     <td>
  47.          Application Name :   
  48.          </td>
  49.          <td>
  50.          <input type="text" class="menuTextBox" name=applicationName value="" >
  51.          </td>
  52.    </tr>
  53.    <tr> <td>
  54.          Application Description : 
  55.          </td>
  56.          <td>
  57.         <input type="text" class="menuTextBox" name=applicationDesc value="" >
  58.          </td>
  59.    </tr>
  60.    <tr>  <td>   
  61.         Variable Name :
  62.         </td>
  63.         <td>
  64.          <input type="text" class="menuTextBox" name=variableName value="">
  65.          </td>
  66.     </tr>
  67.     <tr> <td>
  68.         Variable Text :
  69.         </td>
  70.         <td>
  71.          <input type="text" class="menuTextBox" name=variableText value="">
  72.          </td>
  73.      </tr>
  74.      <tr><td>
  75.          <input type="button" class="btnNormal" name=update value="Update">
  76.          </td>
  77.          <td>
  78.          <input type="button" class="btnNormal" name=add value="Add" onClick="addForm()">
  79.          </td>
  80.      </table>
  81.      </html:form>
  82.  
  83.   </body>
  84. </html>
Aug 4 '07 #1
Share this Question
Share on Google+
1 Reply


pbmods
Expert 5K+
P: 5,821
Heya, taraprasad. Welcome to TSDN!

Please use CODE tags when posting source code. See the REPLY GUIDELINES on the right side of the page next time you post.

There's no document.parameter in your code. styleid sets the ID, not the NAME. Instead, try using
Expand|Select|Wrap|Line Numbers
  1. document.getElementById('parameter')
  2.  
instead.
Aug 4 '07 #2

Post your reply

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