Wrox Programmer Forums
| 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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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
 
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




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





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.