Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Basics
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old January 19th, 2006, 07:24 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default



;;;<select name="id" size="10" style="width:200;" onchange="go1(identity,keyword);">
I assume from your code identity and keyword variables you have created somewhere else?
Do they hold values? (view source and check the html, are there values there?)

If values are present then:
I dont understand why you fail to answer questions. ARE THE VALUES BEING ALERTED (lets try shouting)


Wind is your friend
Matt
Reply With Quote
  #12 (permalink)  
Old January 19th, 2006, 07:39 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

THis:

Code:
function go1(id){
bookSelect.action = 'showversea.asp?id=' + id + '&keyword=<%=Keyword%>';
alert(bookSelect.action);
// bookSelect.submit();
}
And

Code:
        <form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
        <select name="id" size="10" style="width:200;" onchange="go1();">


Renders:
Code:
showversea.asp?id=undefined&keyword=brutish fool
brutish fool is an example.
But when I take out the alert and enter the submit I get:
Code:
http://127.0.0.1/wheelofgod/showversea.asp?id=15418
Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
Reply With Quote
  #13 (permalink)  
Old January 19th, 2006, 07:48 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

You can not call a function like :
onchange="go1();">

and then tell the function its expecting a variable:
function go1(id)

Your code has changed from post to post, I dont understand...


Wind is your friend
Matt
Reply With Quote
  #14 (permalink)  
Old January 19th, 2006, 08:03 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

Yes sorry. In my impatience I've asked in different forums. It's still inconclusive but they suggested different things. I've waited days to solve this.
If I add:
onchange="go1(id);">
then the allert gives:
showversea.asp?id=&keyword=brutish fool
The url would also need a brutish+fool.


Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
Reply With Quote
  #15 (permalink)  
Old January 19th, 2006, 08:12 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

What you are doing is very simple, you have been given a solution.

I have given you my time, you continue to change your code and are slack in answering questions.

Dont be sorry, you need to learn how to help others help you - its not that hard...

Good luck with your JS problem in the ASP area

Wind is your friend
Matt
Reply With Quote
  #16 (permalink)  
Old January 19th, 2006, 08:33 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

OK here:
Code:
        function go1(identity,keyword)
        {
           bookSelect.action = 'showversea.asp?id=' + identity + '&keyword=' + keyword;
           bookSelect.submit();
        }

and
Code:
    <form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
        <select name="id" size="10" style="width:200;" onchange="go1(identity,keyword);">
Line 24
char 1
error object expected


Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
Reply With Quote
  #17 (permalink)  
Old January 19th, 2006, 08:39 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

Sorry. I forgot the alerts. But no alert comes up and the only error is line 24.
Code:
var identity
function go1(identity,keyword)
{
   alert(identity);
   alert(keyWord);
   bookSelect.action = 'showversea.asp?id=' + identity + '&keyword=' + keyword;
   bookSelect.submit();
}
As much as you spent time answering my posts I want to thank you for it and I am looking forward to finishing this.

Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
Reply With Quote
  #18 (permalink)  
Old January 19th, 2006, 08:45 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

Of wow now it shows that keyword is undefined. Ok so I fixed that:
Code:
var keyword
var identity
function go1(identity,keyword)
{
   alert(identity);
   alert(keyword);
   bookSelect.action = 'showversea.asp?id=' + identity + '&keyword=' + keyword;
   bookSelect.submit();
}
Ok the alerts are coming twice on each selection saying "undefined". WHat does that mean?

Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
Reply With Quote
  #19 (permalink)  
Old January 19th, 2006, 08:50 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Your error is because of this line. Change:
onchange="go1(identity,keyword);">
To:
onchange="go1('identity','keyword');">

And your code will work. This works:

<HTML>
 <HEAD>
  <TITLE>test</TITLE>
  <SCRIPT type='text/javascript'>
  <!--
        function go1(identity,keyword)
        {
           bookSelect.action = 'showversea.asp?id=' + identity + '&keyword=' + keyword;
           alert(bookSelect.action);
           //bookSelect.submit();
        }

  -->
  </SCRIPT>
 </head>
<body>
<form name="bookSelect" action="showversea.asp" method="get" target="ifrVerse">
 <select name="id" size="10" style="width:200;" onchange="go1('identity','keyword');">
  <option value="1">One</option>
  <option value="2">Two</option>
 </select>
</form>
</body>
</html>






I have run this code, it works.

Wind is your friend
Matt
Reply With Quote
  #20 (permalink)  
Old January 19th, 2006, 09:07 PM
Friend of Wrox
Points: 1,107, Level: 13
Points: 1,107, Level: 13 Points: 1,107, Level: 13 Points: 1,107, Level: 13
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2004
Location: , , .
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
Default

ok the alert says:
showversea.asp?id=identity&keyword=keyword
Where should I go from this point?
But I still get line 24 error object expected.



Martial Law 9/11 Rise of the Police State is now available! Visit our Martial Law movie section for complete info (click here), or order now by clicking the button below or by calling 888-253-3139
http://www.infowars.com/martial_law_911.htm
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
New and reorganized categories and forum topics jminatel Forum and Wrox.com Feedback 5 July 15th, 2010 06:05 AM
need sample code for read txt file lawsoncobol Access VBA 4 July 16th, 2007 08:30 AM
Easier page navigation of search results gs99 Forum and Wrox.com Feedback 0 February 2nd, 2007 09:38 PM
Read first!!!: Where is the code for a Wrox book jminatel All Other Wrox Books 0 March 17th, 2004 04:43 PM
Read first!!!: Where is the code for a Wrox book jminatel Wrox Book Feedback 0 September 15th, 2003 11:30 AM



All times are GMT -4. The time now is 06:05 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.