SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Jan 2012
    Location
    Philippines
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post JQuery URL link problem

    Hi,

    I am new to jQuery and my background is in classic ASP. I coded two ASp files, one is for data entry of Month and Year.. and the other ASP file is supposed to fetch the entry and process them. The code is as follows;

    Code:
    <script type="text/javascript" src="jquery-1.2.6.min.js"></script>
    <script type="text/javascript">
     function loadingAjax(myDiv, myLink) {
    	$("#"+myDiv).html('<img src="images/wait.gif">');
    	$.ajax({
    		type: "POST",
    		url: myLink,
        data: "qCompany=iNFODynamics",
    		success: function(msg){
    			$("#"+myDiv).html(msg);}
      	});
      }	
    
    function loadNow(div_id) {
      var theDiv = div_id;
      var theLink = "ajaxLoader.asp?qFunc=event&qTrnMonth=" + document.getElementById("qTransmonth").value + "&qTrnYear=" + document.getElementById("qTransyear").value;
    	loadingAjax(theDiv, theLink);
     }
    </script>
    </head>
    <body>
    <div style="margin:10px; width:500px;">
      <form name="form1" method="post" />
      <table border="1" cellpadding="1" cellspacing="5" width="100%">
        <td align="right" width="110">Entry point==></td>
        <td>&nbsp;
          <label>Month <input type="text" name="qTransmonth" id="qTransmonth" value="<%=trim(trnMonth)%>" size="13" maxlength="12" /></label>
          <label>Year <input type="text" name="qTransyear" id="qTransyear" value="<%=trim(trnYear)%>" size="8" maxlength="4" /></label>
          <input type="button" class="btn" name="btnSubmit" id="btnSubmit" value="View Now" onclick="loadNow('ajaxDiv');" />
        </td>
      </table>
      <div id="ajaxDiv"></div>
    	</form>
    </div>
    The ajaxLoader.asp page is supposed to fetch it and process the entry BUT it is not transferring to this page;
    Code:
    <%@language="vbscript" codepage="1252"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <%
    'normal page initialization
    Dim trnMonth, trnYear
    qry = trim(request.Querystring("qFunc"))
    if qry = "event" then
      trnMonth = trim(request.Querystring("qTrnMonth")
      trnYear = trim(request.Querystring("qTrnYear")
    end if
    %>
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head><title>MAGIC Appliance Center, Inc. - Ajax Page Loader</title>
    <meta http-equiv="content-type" content="text/html; charset=us-ascii" />
    <link rel="stylesheet" type="text/css" href="style%20sheet1.css" />
    </head>
    <body>
    <div style="border:1px solid #9966cc;">
      <p>Ambabangel... asumpal la!!!</p>
    	<p>Entered transaction month is;&nbsp;<%=trnMonth%></p>
    	<p>Entered transaction year is;&nbsp;<%=trnYear%></p>
    	<p>&nbsp;</p>
    </div>
    </body>
    </html>
    What is happening here??

  2. #2
    SitePoint Guru
    Join Date
    Jun 2007
    Posts
    675
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    change:

    trnMonth = trim(request.Querystring("qTrnMonth")
    trnYear = trim(request.Querystring("qTrnYear")

    to

    trnMonth = trim(request.Querystring("qTrnMonth"))
    trnYear = trim(request.Querystring("qTrnYear"))

    You are missing some closing parentheses, which is throwing an error and preventing completion of the script.

  3. #3
    SitePoint Member
    Join Date
    Jan 2012
    Location
    Philippines
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh men!! What a dumb mistake!

    Thanks @webber


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •