HTML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignHTML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 29th, 2000, 06:22 PM
terium terium is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2000
Posts: 60 terium User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 9
Send a message via ICQ to terium
I have a page where you can edit info for a bunch of different
organizations, so I have a dropdown list which lists them all and then
when you click on one, the title changes. I was using ASP and it
worked. I switched to PHP and it doesn't work. I can't figure out why.

-Whenever I select a new organization, the JavaScript sets the variable
'str' to "[object]".-

If anyone can help, here's all of the code I'm using (read down for more
info):

<BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">code:</font><HR><pre>
<?
function connectDB($dbname, $query) {
$dbconnect = odbc_connect($dbname, "login", "password"); //note that I
DO have the login/pass OK
return odbc_exec($dbconnect, $query);
}

//INCLUDE AT TOP OF EVERY PAGE (except logon)!!!
//END WITH: </head><body class="general"...>...</body></html>

//Check if user has logged in: redirect if false
$sPageTitle = "Organization Maintenance";
if (!$ssnEmail) {
header("Location: index.php");
}
?>
<html>
<head>
<title><?=$sPageTitle?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="global.css" type="text/css">
<!--
<META HTTP-EQUIV="Expires" CONTENT="Fri, Jun 12 1981 08:20:00 GMT">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
-->
<script language="JavaScript">
<!--
function MM_Reload(selObj,restore){ //v3.0
var str = selObj.options[selObj.selectedIndex];
eval("parent.frames['Menu'].location='menu.php?org_desc="+str+"'");
eval("parent.frames['Main'].location='home.php'");
if (restore) selObj.selectedIndex=0;
var str = "Maintenance for " + str;
//Change title
if(document.layers) { // if Navigator 4.0+
with(document['orgdiv'].document) {
open();
write(str);
close();
}
} else { // Internet Explorer 4.0+
document.all['orgdiv'].innerHTML = str;
}
}
//-->
</script>
</head>
<body bgcolor="#D0DCE0" class="general">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td align="center">
<div id="orgdiv">Maintenance for <?=$ssnLongOrg?></div>
<br>
<select name="OrgJump" onChange="MM_Reload(this,1)">
<option selected>Switch Organization</option>
<?
$dbCustOrgsID = connectDB("WEB_CustData", "select
organization_abbreviation, organization from organizations order by
Organization");
while (odbc_fetch_row($dbCustOrgsID)) {
?>
<option value="<?=odbc_result($dbCustOrgsID,
"organization")?>"><?=odbc_result($dbCustOrgsID, "organization")?></option>
<?
}
?>
</select>
</td>
</tr>
</table>
</body>
</html>
[/code]
Now, don't worry too much about the PHP if you don't know it because I
get the correct output with it:

<select name="OrgJump" onChange="MM_Reload(this,1)">
<option selected>Switch Organization</option>
<option value="Some name">Some name</option>
<option value="Other org">Other org</option>
</select>

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignHTML Programming > getting drop-down list value: always "[object]"


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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 On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway