 |
| 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
|
|
|
|

January 19th, 2006, 07:24 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
;;;<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
|
|

January 19th, 2006, 07:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 19th, 2006, 07:48 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

January 19th, 2006, 08:03 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 19th, 2006, 08:12 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

January 19th, 2006, 08:33 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 19th, 2006, 08:39 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 19th, 2006, 08:45 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|

January 19th, 2006, 08:50 PM
|
|
Friend of Wrox
|
|
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
|
|
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
|
|

January 19th, 2006, 09:07 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2004
Posts: 240
Thanks: 0
Thanked 1 Time in 1 Post
|
|
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
|
|
 |