Click here to Skip to main content
13,095,218 members (77,720 online)
Rate this:
Please Sign up or sign in to vote.
See more:
function showUser(str,st1)
if (str=="" AND st1=="")
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
Enter the Register No: &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="reg"/><br /><br />
<input type="radio" value="K"  name="s1" >K/L/R/O/N-scheme &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="radio" value="J" name="s1" >J/C/D/G-scheme
<br /><br />
<input type="submit" value="View" name="submit" id="valuebtn" onClick="oload()" />
<div id="txtHint"><b>Person info will be listed here.</b></div>
<script type="text/javascript">
function oload(){
    document.getElementById('valuebtn').onclick = function() {
    var s = document.getElementById('reg').value;
    var ss = document.getElementById('s1').value;

The above program is written for checking result myself with the help of original website. with the help of ajax XMLHttpRequest, am passing the values over function. but it not response. can any one help me.?
Posted 15-Mar-13 9:03am
Updated 15-Mar-13 9:06am
ryanb31 15-Mar-13 15:06pm
What? I don't understand where you are stuck.
hari301 15-Mar-13 15:20pm
the program didn't response and Unexpected string error below the line of ""GET",""+str"&regul="+st1,true);"
while i run the program
Prasad Khandekar 15-Mar-13 16:47pm

I think I have answered your earlier question on the same lines.

hari301 15-Mar-13 17:14pm
i tired to run this program, and am not expert in ajax, just a beginner. somewat i learned from cross domain request using XMLHttpRequest. but url doesn't return the page to div content.
Chinmaya_Champatiray 15-Mar-13 22:34pm
there are 3 observations:

if (str=="" AND st1=="")
in the above line AND is invalid instead you should use && operator.

here parameters are not properly given, rather you should write as follows:"GET",""+str+"®ul="+st,true);

var s = document.getElementById('reg').value;
var ss = document.getElementById('s1').value;

where as in the html design you don't have any control with id 'reg' and 's1'. you have assigned name to the controls but ids are not given.
<input type="text" name="reg"/>

please correct these and try to invoke.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 15 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100