473,472 Members | 2,173 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

problem in validating the form

149 New Member
hi,
in my web-application..im facing the problem 'Unable to retrieve'...may i know why..i had done validations for my form...but when im submitting it is not get submitted and i used Firebug and im getting error in Console as '500 Internal Server Error' may i know why..here is my javascript code..

Expand|Select|Wrap|Line Numbers
  1. function trim(stringToTrim) {
  2.     return stringToTrim.replace(/^\s+|\s+$/g, "");
  3. }
  4. var xmlHttp = null;
  5. function login() {
  6.     if (validate()) {
  7.         try {
  8.             // Firefox, Opera 8.0+, Safari
  9.             xmlHttp = new XMLHttpRequest();
  10.         } catch (e) {
  11.             // Internet Explorer
  12.             try {
  13.                 xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
  14.             } catch (e) {
  15.                 xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  16.             }
  17.         }
  18.         var pname = document.getElementById("packName").value;
  19.         var url = "/XmlGprs1/RegisterXml?name=login";
  20.         url = url + "&pname=" + pname;
  21.         xmlHttp.onreadystatechange = stateChanged;
  22.         xmlHttp.open("GET", url, true);
  23.         xmlHttp.send(null);
  24.     }
  25. }
  26. function stateChanged() {
  27.     if (xmlHttp.readyState == 4) {
  28.         if (xmlHttp.status == 200) {
  29.             parseMsg();
  30.         } else {
  31.             alert("Unable to retrieve");
  32.         }
  33.     }
  34. }
  35. function trim(stringToTrim) {
  36.     return stringToTrim.replace(/^\s+|\s+$/g, "");
  37. }
  38. function parseMsg() {
  39.  
  40.     // PACK_NAME validation
  41.     var pname = document.getElementById("packName").value;
  42.     response = xmlHttp.responseXML.documentElement;
  43.     var valid = true;
  44.     var packNodes = response.getElementsByTagName("PACK_NAME");
  45.     for ( var i = 0; i < packNodes.length; i++) {
  46.         var packNode = packNodes.item(i);
  47.         var packNodeChilds = packNode.childNodes;
  48.         for ( var j = 0; j < packNodeChilds.length; j++) {
  49.             var packNodechild = packNodeChilds.item(j);
  50.             if (packNodechild.nodeType == Node.TEXT_NODE) {
  51.                 //alert(childNode.nodeValue);
  52.                 if ( packNodechild.nodeValue == pname) {
  53.                     alert("Pack Name Already Exists");
  54.                     valid = false;
  55.                 }
  56.             }
  57.         }
  58.     }
  59. if(valid){
  60.         document.frm.submit();
  61.     }
  62. }
  63.  
thanks,
madhu.
Aug 2 '10 #1
2 1043
hsriat
1,654 Recognized Expert Top Contributor
500 Server error has got nothing to do with JavaScript. Check your server side code.
Aug 5 '10 #2
madhuriks
149 New Member
hi gud mrng,
i had checked and i got it....thanks for ur reply...
Aug 6 '10 #3

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

Similar topics

12
by: Tom | last post by:
Hi all, I am a newbe to javascript so I could use your help. I checked the FAQs and searched google but I could not resolve this problem. My form is as follows: <form...
12
by: Torbjørn Pettersen | last post by:
I'm having problems validating my HTML code because of some ASP code I'm using: ---Start Code--- <% If rs("Average") = 0 Then VotingImage = "<img src="/images/0.gif" alt='No votes yet'>"...
1
by: sman | last post by:
Hi, I recently read this article on About.com on how to create required fields for a form: http://javascript.about.com/library/scripts/blformvalidate.htm Everything works great except that there...
8
by: Shane Jones | last post by:
on my php page i have a submit button and when I submit i want to validate that dome fields have data in. i have this as my submit button <input name="Enter" type="button"...
3
by: Blas Croche Solana | last post by:
Hello, I am trying to validate a VXML document against the new vxml 2.0 schema, and I am getting the following errors (and a lot more like these): Reference to undeclared substitution group...
17
by: stathis gotsis | last post by:
Hello everyone, I am tying to come up with an elegant way to process some input data that come from a form. When the user hits the 'Submit' button, i want the form to appear again with the...
6
by: Mark | last post by:
so after much searching, and thinking, and pondering and planning, i came up with this most amazing thing, and then realized one major flaw which i was hoping you guys might help me overcome. ...
4
by: Anthony P | last post by:
Hello Everyone, I am having some trouble getting my JavaScript to validate my form fields. I've included more information below. My explaination of the code is in ALL CAPS so it stands out from...
3
by: Louis | last post by:
I have a form with multiple input boxes. I want to validate each input box (and force user to correct it) before allowing user to move to another, either using tab key or a mouse click. I try...
1
by: marciojersey | last post by:
Hi everyone. I'm having a problem with form opacity in my c# application. I have a window with a vrml viewer com control and whenever the window goes into layered mode, the vrml viewer is rendered...
0
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
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,...
1
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
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
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
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.