p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Web Programming > JavaScript > BOOK: Beginning JavaScript
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning JavaScript
This is the forum to discuss the Wrox book Beginning JavaScript by Paul Wilton; ISBN: 9780764544057

Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning JavaScript section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old July 13th, 2004, 11:50 AM
Authorized User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It looks like it does not pick up a value for StockId. This is the code from the form:

<input type="hidden" name="txtStockId" VALUE="<%Request.QueryString("StockId")%>">

which is supposed to retreive the StockId from the database.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #12 (permalink)  
Old July 13th, 2004, 12:05 PM
Friend of Wrox
Points: 2,801, Level: 22
Points: 2,801, Level: 22 Points: 2,801, Level: 22 Points: 2,801, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Request.QueryString retrieves values from the address bar, not a database.

Snib

<><
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #13 (permalink)  
Old July 14th, 2004, 03:19 AM
Authorized User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Sorry, it is suppose to retrieve it from the address bar, but it doesn't, although i can clearly see the value in the address bar.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #14 (permalink)  
Old July 14th, 2004, 05:25 AM
Authorized User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

That's what the address bar looks like:

http://localhost/test_database/buyitem.asp?StockId=5

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #15 (permalink)  
Old July 14th, 2004, 10:12 AM
Friend of Wrox
Points: 2,801, Level: 22
Points: 2,801, Level: 22 Points: 2,801, Level: 22 Points: 2,801, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2003
Location: , , .
Posts: 1,285
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ohhhhhhhhhhh OK i see the problem now. You're missing an equals sign:

<input type="hidden" name="txtStockId" VALUE="<%Request.QueryString("StockId")%>">
should be:
<input type="hidden" name="txtStockId" VALUE="<%=Request.QueryString("StockId")%>">

Man, I can't believe I didn't catch that.... ;)

HTH,

Snib

<><
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #16 (permalink)  
Old July 14th, 2004, 11:03 AM
Authorized User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 11
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Cheers Mate, that sorted it.

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #17 (permalink)  
Old February 22nd, 2005, 01:43 PM
Registered User
Points: 15, Level: 1
Points: 15, Level: 1 Points: 15, Level: 1 Points: 15, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2005
Location: , , .
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I'm having the same problem. I have used the book code plus the suggested code from terry s above - still getting a syntax error problem.

Here's my code that supplies the data: -

<body bgcolor="#FFFFFF">
<p align="center">Please enter your customer ID and the number of seats you would
  like to reserve</p>
<form name="form1" language=JavaScript method="post" action="AddTable.asp" onsubmit="return form1_onsubmit()">
<input type="text" name=txtBook_ID value="<%=Request.QueryString("Booking_ID")%>">
<input type="text" name=txtDate value="<%=Request.QueryString("DateBooked")%>">
<input type="text" name=txtTime value="<%=Request.QueryString("Time")%>">
<input type="text" name=txtSeatNo value="<%=Request.QueryString("SeatsRemaining")%>" >
  <table width="700" border="1" align="center">
    <tr>
      <td>
        <div align="right">Customer ID</div>
      </td>
      <td>
        <input type="text" name="txtCustID">
      </td>
      <td>
        <div align="right">Number of Seats</div>
      </td>
      <td>
        <input type="text" name="txtSeatNo">
      </td>
    </tr>
    <tr>
      <td colspan="2">
        <div align="center">
          <input type="reset" name="Reset" value="Reset">
        </div>
      </td>
      <td colspan="2">
        <div align="center">
          <input type="submit" name="Submit" value="Book this table">
        </div>
      </td>
    </tr>
  </table>
</form>
<p>&nbsp;</p>
<p align="center">&nbsp;</p>
<p>&nbsp; </p>
</body>

And the code on the page that inserts the data: -

<%

var ci = Request.Form("txtCustID");
var dt = Request.Form("txtDate");
var tm = Request.Form("txtTime");
var sn = Request.Form("txtSeatNo");

adoConnection = Server.CreateObject("ADODB.Connection");
adoConnection.Open("DSN=SunInnDB");

var SQL = "INSERT INTO tblBookings (CustID,Date,Time,SeatsBooked)";
SQL = SQL + "VALUES('"+ci+"','"+dt+"','"+tm+"','"+sn+"')";

adoConnection.Execute(SQL);
adoConnection.Close();
adoConnection = null;

%>

Help appreciated

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
NEED HELP INSERT INTO statement syntax error koco ASP.NET 1.0 and 1.1 Basics 6 June 2nd, 2006 05:01 PM
Syntax error in INSERT INTO statement mega ASP.NET 1.0 and 1.1 Basics 3 January 12th, 2005 04:30 PM
Syntax error in INSERT INTO statement evol77 ASP.NET 1.1 2 December 17th, 2004 06:15 AM
Syntax error in INSERT INTO statement. askaggs Classic ASP Databases 5 June 10th, 2004 01:21 AM
Syntax error in INSERT INTO statement sankar ASP.NET 1.1 9 May 20th, 2004 03:48 PM



All times are GMT -4. The time now is 06:18 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc