Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. 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 Databases 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, 2007, 07:29 AM
Authorized User
 
Join Date: Jan 2007
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pushpa
Default onChange method of <select> in Html not working

<%@ language=VBScript %>



<%
dim itemp
itemp=10

%>
<!'DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Encore Support Portal</title>
<style type="text/css">
<!--
body, td, th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: #FFFFFF;
}
-->
</style>
<link href="sitestyles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
    color: #3F4750;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #3F4750;
}
a:hover {
    text-decoration: underline;
    color: #141619;
}
a:active {
    text-decoration: none;
    color: #3F4750;
}
-->
</style></head>
<body>

I m not able to execute this program.
Syntax Error is comming for this program.
Microsoft VBScript compilation (0x800A03EA)
please give me the solution. and send it on
[email protected]



 
Old January 19th, 2007, 12:42 PM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What has this got to do with "onChange method of <select> in Html not working" ?
And what has this got to do with ASP Databases?


Woody Z
http://www.learntoprogramnow.com
 
Old January 23rd, 2007, 03:19 AM
Authorized User
 
Join Date: Jan 2007
Posts: 40
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to pushpa
Default


<%
dim itemp
itemp=10

%>
<!'DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Encore Support Portal</title>
<style type="text/css">
<!--
body, td, th {
    font-family: Verdana, Arial, Helvetica, sans-serif;
    font-size: 11px;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: #FFFFFF;
}
-->
</style>
<link href="sitestyles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
a:link {
    color: #3F4750;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #3F4750;
}
a:hover {
    text-decoration: underline;
    color: #141619;
}
a:active {
    text-decoration: none;
    color: #3F4750;
}
-->
</style></head>
<body>
Before function call:-
<%=itemp%>
<%Response.Write("<br>")%>
<select name="chk" id="select1" size="1" onchange="<%chkfun(&%>chk.options[selectedIndex].value<%&)%>">

<option value="<%itemp=88%>">Test1</option>
<option value="<%itemp=99%>">Test2</option>
</select>
<%Response.Write("<br>")%>
After function called:-
<%=itemp%>
<%
function chkfun(it)
itemp=it
end function
%>



</body>
</html>
this code gives error

 
Old January 23rd, 2007, 09:32 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

You are wiring up a client side event to server side code, this will not work in this implementation.

================================================== =========
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
^^Took that from planoie's profile^^
^^Modified text taken from gbianchi profile^^
================================================== =========
 
Old January 23rd, 2007, 11:20 AM
Friend of Wrox
 
Join Date: May 2006
Posts: 643
Thanks: 0
Thanked 0 Times in 0 Posts
Default

There are a number of issues with your code.
As Doug points out, you are attempting to use code on the server that isn't available on the server, and code in the browser that isn't available on the browser.

The onChange attribute of the select element will run code (either Javascript or VbScript) in the browser - so your challenge is to make some very simple tests with no extra features (like the CSS and etc).
I would suggest that you write this code as pure HTML with client side javascript (or vbscript) and NO serverside code at all so you can get the feel for how clientside code works. That is - you are using serverside blocks of code througout that are not actually doing anything and in some cases can't even complile. Take out everything that doesn't compile and then add back in the pieces you need.

For example, you need to re-write this (which makes no logical sense):
Code:
<option value="<%itemp=88%>">Test1</option>
as this:
Code:
<option value="88">Test1</option>
and so on...

Woody Z
http://www.learntoprogramnow.com





Similar Threads
Thread Thread Starter Forum Replies Last Post
<select> </select> prabhash_singh11 PHP How-To 2 March 11th, 2008 09:08 AM
select="<b>" AlDugan XSLT 8 March 24th, 2006 02:01 PM
<style> tags in a <body> vs. <div> bcat BOOK: Beginning CSS: Cascading Style Sheets for Web Design ISBN: 978-0-7645-7642-3 1 March 27th, 2005 08:50 AM
HELP: XSL -> HTML <select selected=true> jedbartlett XSLT 4 October 7th, 2004 11:16 PM
Dynamic HTML <<Events>> babloo81 Javascript 2 December 29th, 2003 12:40 PM





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