Go Back   Computer Forums > Web Design | Website Development > Web Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 02-14-2005, 11:08 AM   #11
Baseband Member
 
Join Date: Feb 2005
Posts: 21
Default

LOL, after I put the script section after the html I started getting an object expected error. Unless I put it in the wrong spot.

</script>
<html>
<body>
<form name="form1">
<table border=1>
<tr>
<td>
<select name="dropdn1" OnChange="change_form();">
<option name="val1" value="val1" SELECTED>val1</option>
<option name="val2" value="val2">val2</option>
</select>
</td>
<td>
<div id="formxyz">
<select name="subselect">
<option value="1" name="1">1a</option>
<option value="1" name="1">2a</option>
<option value="1" name="1">3a</option>
<option value="1" name="1">4a</option>
</select>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>

<script>
function change_form()
{
var el = document.getElementById? document.getElementById('formxyz'): document.all['formxyz'];
var formx1 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1a</option><option value=\"1\" name=\"1\">2a</option><option value=\"1\" name=\"1\">3a</option><option value=\"1\" name=\"1\">4a</option></select>";
var formx2 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1b</option><option value=\"1\" name=\"1\">2b</option><option value=\"1\" name=\"1\">3b</option><option value=\"1\" name=\"1\">4b</option></select>";
if (document.form1.dropdn1.value=="val1")
{
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx1;
}
if (document.form1.dropdn1.value=="val2")
{
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx2;
}
}

Alright there's gotta be something missing in my text above these lines that im missing because I copied this text into a new blank html and it worked. Can you take some time to look at the text up to yours?
__________________

midntcowboy25 is offline   Reply With Quote
Old 02-14-2005, 11:21 AM   #12
Baseband Member
 
Join Date: Feb 2005
Posts: 21
Default

<html>

<head>

<SCRIPT LANGUAGE="JavaScript">
<!--
function dmsJS_submitHrefSearchCIVARC(){document.submitSear chCIVARC.submit()}
function dmsJS_submitHrefSearchELEC(){document.submitSearch ELEC.submit()}
function dmsJS_submitHrefSearchINSTR(){document.submitSearc hINSTR.submit()}
function dmsJS_submitHrefSearchMECH(){document.submitSearch MECH.submit()}
function dmsJS_submitHrefSearchPROCESS(){document.submitSea rchPROCESS.submit()}
// -->
</SCRIPT>



<STYLE type="text/css">
.body {
color: #000000;
font-family: Verdana;
font-weight: normal;
font-size:9pt;
}
.form {
color: #404040;
font-size:8pt;
margin-top: 0px;
font-family: verdana;
font-weight:normal;
font-variant:small-caps;
}

.docsearch {
color: #404040;
font-size:10pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

.quicksearch {
color: ##000080;
font-size:9pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

.date {
margin-left:10px;
margin-right:5px;
color: #cccc99;
font-size:8pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

A:link {
COLOR: blue;
TEXT-DECORATION: none
}

A:visited {
COLOR: blue;
TEXT-DECORATION: none
}

A:active {
COLOR: blue;
TEXT-DECORATION: none
}

A:hover {
TEXT-DECORATION: underline
}

</STYLE>

</head>

<SCRIPT src="http://hscnt7.americas.dowcornusa.com/engserv/functions.js"></SCRIPT>



<basefont face="Arial" color="BLACK" size=3>


<!--webbot bot="Include" U-Include="header.htm" TAG="BODY" startspan --><p><em>[header.htm]</em></p>
<!--webbot bot="Include" endspan i-checksum="902" --><p>&nbsp;</p>

<div align="center">
<center>

<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" width="864">
<TR><TD HEIGHT="20" align="center" width="220"></TD></TR>
<TR>

<!-- START INTRO PANEL -->
<TD VALIGN="TOP" align="center" width="220">
<div align="center">
<center>
<TABLE WIDTH="192" BORDER="0" CELLSPACING="0" CELLPADDING="5">
<TR><TD width="180"><img border="0" src="images/falcon.gif" width="95" height="72"></TD></TR>
</center>
</center>
<TR><TD bgcolor="#FFFFFF" width="180">
<p align="left">
<span class=body><font color="#000080"><b>Welcome to the Search/View/Print page.&nbsp;</b></font><br>
<br>
Engineering documents and drawings are available to search, view,
and print through the intranet.<br>
<br>
Documents and drawings may be accessed using a variety of search criteria or with quick searches.</span>
<p align="left">
<span class=body><b><font size="2"><span style="background-color: #FFFF00"><a href="javascript:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/downloadinstructions.htm',475,475)">Drawing
Viewer Update</a></span> &nbsp;</font></b>
</span></p>
<p align="left">
<span class=body><b>First time users</b>:&nbsp; To view drawings <a href="javascript:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/downloadinstructions.htm',475,475)">download
the viewer.</a><br>
<br>
<a href="javascript:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/searchtipstable.htm',500,600)">
Tips for searching</a> &nbsp;<br>
<a href="javascript:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/viewingtips.htm',625,400)">Tips for
viewing drawings<br>
</a>&nbsp;<br>
</span><a href="http://corpnt4c/engineering/default.htm"><img border="0" src="Images/ezweb.gif" width="168" height="22"></a></p>
</TD>
<center>

<center>
<TR><TD height="30" valign="bottom" width="180">&nbsp;
<p>&nbsp;</TD></TR>
</TABLE>
</center>
</div>
</center>
</TD>
<!-- END INTRO PANEL -->
<TD WIDTH="6" align="center"></TD>
<!-- START SEARCH FORM -->
<TD VALIGN="TOP" align="center" width="360">

<table width="360" cellpadding="2" border="0" align="center">
<form action='/scripts/falcon/dmswebs.exe' method='POST' Name='submitSearch'>
<input type=hidden name="startForm">
<input type=hidden name="RequestMode" value="JobRequestMode">
<input type=hidden name="SessionID" value="userid">
<TR>
<TD HEIGHT="30" COLSPAN="3" ALIGN="CENTER" VALIGN="TOP"><span class=docsearch>&nbsp;EMTN Search</span></TD></TR>
<tr>
<td align="left"><span class=form>DESCRIPTION</td>
<td align="left"><INPUT TYPE=text Name="Description" Size=30></td>

<script>
function change_form()
{
var el = document.getElementById? document.getElementById('formxyz'): document.all['formxyz'];
var formx1 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1a</option><option value=\"1\" name=\"1\">2a</option><option value=\"1\" name=\"1\">3a</option><option value=\"1\" name=\"1\">4a</option></select>";
var formx2 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1b</option><option value=\"1\" name=\"1\">2b</option><option value=\"1\" name=\"1\">3b</option><option value=\"1\" name=\"1\">4b</option></select>";
if (document.form1.dropdn1.value=="val1")
{
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx1;
}
if (document.form1.dropdn1.value=="val2")
{
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx2;
}
}



</script>
<html>
<body>
<form name="form1">
<table border=1>
<tr>
<td>
<select name="dropdn1" OnChange="change_form();">
<option name="val1" value="val1" SELECTED>val1</option>
<option name="val2" value="val2">val2</option>
</select>
</td>
<td>
<div id="formxyz">
<select name="subselect">
<option value="1" name="1">1a</option>
<option value="1" name="1">2a</option>
<option value="1" name="1">3a</option>
<option value="1" name="1">4a</option>
</select>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
</script>
<html>
<body>
__________________

midntcowboy25 is offline   Reply With Quote
Old 02-14-2005, 11:22 AM   #13
Baseband Member
 
Join Date: Feb 2005
Posts: 21
Unhappy

Sorry I know there's a little bit of extra information there but theres gotta be something I am missing I just cant see it for some reason.
midntcowboy25 is offline   Reply With Quote
Old 02-14-2005, 11:40 AM   #14
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: java

The problem was that the form you started wasn't closed, the the object document.form1.dropdn didn't exists it was document.seachsubmit.form1.dropdn
I'm not sure you can nest forms and still refere to them in javascript. anyway, the easiest thing to do was remove the second form opening tag (form name="form1">
and change the script at the top to refere to the correct form.
I left the </form> tage so that your form was closed.
Code:
<html>

<head>

<SCRIPT LANGUAGE="JavaScript">
<!--
function dmsJS_submitHrefSearchCIVARC(){document.submitSearchCIVARC.submit()}
function dmsJS_submitHrefSearchELEC(){document.submitSearchELEC.submit()}
function dmsJS_submitHrefSearchINSTR(){document.submitSearchINSTR.submit()}
function dmsJS_submitHrefSearchMECH(){document.submitSearchMECH.submit()}
function dmsJS_submitHrefSearchPROCESS(){document.submitSearchPROCESS.submit()}
// -->

function change_form()
{
var el = document.getElementById? document.getElementById('formxyz'): document.all['formxyz'];
var formx1 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1a</option><option value=\"1\" name=\"1\">2a</option><option value=\"1\" name=\"1\">3a</option><option value=\"1\" name=\"1\">4a</option></select>";
var formx2 = "<select name=\"subselect\"><option value=\"1\" name=\"1\">1b</option><option value=\"1\" name=\"1\">2b</option><option value=\"1\" name=\"1\">3b</option><option value=\"1\" name=\"1\">4b</option></select>";
if (document.submitSearch.dropdn1.value=="val1") 
{ 
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx1;
}
if (document.submitSearch.dropdn1.value=="val2") 
{ 
if (el && typeof el.innerHTML != "undefined") el.innerHTML = formx2;
}
}
</SCRIPT>

<STYLE type="text/css">
.body {
color: #000000;
font-family: Verdana; 
font-weight: normal; 
font-size:9pt;
}
.form {
color: #404040;
font-size:8pt;
margin-top: 0px;
font-family: verdana;
font-weight:normal;
font-variant:small-caps;
}

.docsearch {
color: #404040;
font-size:10pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

.quicksearch {
color: ##000080;
font-size:9pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

.date {
margin-left:10px;
margin-right:5px;
color: #cccc99;
font-size:8pt;
margin-top: 0px;
font-family: verdana;
font-weight:bold;
font-variant:small-caps;
}

A:link {
COLOR: blue;
TEXT-DECORATION: none
}

A:visited {
COLOR: blue;
TEXT-DECORATION: none
}

A:active {
COLOR: blue;
TEXT-DECORATION: none
}

A:hover {
TEXT-DECORATION: underline
}

</STYLE>

</head>

<SCRIPT src="http://hscnt7.americas.dowcornusa.com/engserv/functions.js"></SCRIPT>



<basefont face="Arial" color="BLACK" size=3>


<!--webbot bot="Include" U-Include="header.htm" TAG="BODY" startspan --><p><em>[header.htm]</em></p>
<!--webbot bot="Include" endspan i-checksum="902" --><p>&nbsp;</p>

<div align="center">
<center>

<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0" width="864">
<TR><TD HEIGHT="20" align="center" width="220"></TD></TR>
<TR>

<!-- START INTRO PANEL -->
<TD VALIGN="TOP" align="center" width="220">
<div align="center">
<center>
<TABLE WIDTH="192" BORDER="0" CELLSPACING="0" CELLPADDING="5">
<TR><TD width="180"><img border="0" src="images/falcon.gif" width="95" height="72"></TD></TR>
</center>
</center>
<TR><TD bgcolor="#FFFFFF" width="180">
<p align="left">
<span class=body><font color="#000080"><b>Welcome to the Search/View/Print page.&nbsp;</b></font><br>
<br>
Engineering documents and drawings are available to search, view,
and print through the intranet.<br>
<br>
Documents and drawings may be accessed using a variety of search criteria or with quick searches.</span>
<p align="left">
<span class=body><b><font size="2"><span style="background-color: #FFFF00"><a href="java script:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/downloadinstructions.htm',475,475)">Drawing
Viewer Update</a></span> &nbsp;</font></b>
</span></p>
<p align="left">
<span class=body><b>First time users</b>:&nbsp; To view drawings <a href="java script:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/downloadinstructions.htm',475,475)">download
the viewer.</a><br>
<br>
<a href="java script:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/searchtipstable.htm',500,600)">
Tips for searching</a> &nbsp;<br>
<a href="java script:newWindow('http://hscnt7.americas.dowcornusa.com/falcon/searchtips/viewingtips.htm',625,400)">Tips for
viewing drawings<br>
</a>&nbsp;<br>
</span><a href="http://corpnt4c/engineering/default.htm"><img border="0" src="Images/ezweb.gif" width="168" height="22"></a></p>
</TD>
<center>

<center>
<TR><TD height="30" valign="bottom" width="180">&nbsp;
<p>&nbsp;</TD></TR>
</TABLE>
</center>
</div>
</center>
</TD>
<!-- END INTRO PANEL -->
<TD WIDTH="6" align="center"></TD>
<!-- START SEARCH FORM -->
<TD VALIGN="TOP" align="center" width="360">

<table width="360" cellpadding="2" border="0" align="center"> 
<form action='/scripts/falcon/dmswebs.exe' method='POST' Name='submitSearch'>
<input type=hidden name="startForm">
<input type=hidden name="RequestMode" value="JobRequestMode">
<input type=hidden name="SessionID" value="userid">
<TR>
<TD HEIGHT="30" COLSPAN="3" ALIGN="CENTER" VALIGN="TOP"><span class=docsearch>&nbsp;EMTN Search</span></TD></TR>
<tr> 
<td align="left"><span class=form>DESCRIPTION</td>
<td align="left"><INPUT TYPE=text Name="Description" Size=30></td>



<table border=1>
<tr>
<td>
<select name="dropdn1" OnChange="change_form();">
<option name="val1" value="val1" SELECTED>val1</option>
<option name="val2" value="val2">val2</option>
</select>
</td>
<td>
<div id="formxyz">
<select name="subselect">
<option value="1" name="1">1a</option>
<option value="1" name="1">2a</option>
<option value="1" name="1">3a</option>
<option value="1" name="1">4a</option>
</select>
</div>
</td>
</tr>
</table>
</form>
</body>
</html>
</script>
<html>
<body>
root is offline   Reply With Quote
Old 02-14-2005, 12:21 PM   #15
Baseband Member
 
Join Date: Feb 2005
Posts: 21
Default

Hey root I got it working now, I ended up just taking that Intro Panel out and it worked but now I guess I can put it back in. Thanks for everyting I finally got it working the way I need.
midntcowboy25 is offline   Reply With Quote
Old 05-29-2007, 08:40 PM   #16
Baseband Member
 
Join Date: May 2007
Posts: 27
Default Re: java

Thanks great script

I'm sure other one would have worked better but was too complicated for me to customise for my site

But this one will do for now...

and root if your feeling bored at any point in the next month you could always edit it for me lol if you want to msn me @ whizzell@hotmail.co.uk...

thanx from whizzell and i'm sure dude_se aswell



Quote:
Originally Posted by root View Post
seriously, I'd avise that you look for a nicer menu than a select box, as it's a form control is worked nicely for midntcowboy25's search and subsearch idea...
you'd do better searching somewhere like Javaboutique.internet.com for better menus...

however if you really want to have menus that are select boxes then here you are.

Code:
<script>
function navigate()
{
var menval=document.frm.menu.value;
document.location = (menval);
}
</script>

<body>
<form name="frm">
<select name="menu" Onchange="navigate();">
<option name="1" value="page1.html">1</option>
<option name="2" value="page2.html">2</option>
<option name="3" value="page3.html">3</option>
</select>
</form>
</body>
whizzell is offline   Reply With Quote
Old 05-29-2007, 08:44 PM   #17
Golden Master
 
dude_se's Avatar
 
Join Date: Nov 2004
Posts: 8,632
Send a message via AIM to dude_se Send a message via MSN to dude_se
Default Re: java

Quote:
Originally Posted by whizzell View Post
Thanks great script

I'm sure other one would have worked better but was too complicated for me to customise for my site

But this one will do for now...

and root if your feeling bored at any point in the next month you could always edit it for me lol if you want to msn me @ whizzell@hotmail.co.uk...

thanx from whizzell and i'm sure dude_se aswell
change your email to whizzell AT hotmail.co.uk to avoid spam and post this in your thread aswell for a better response. just a tip
__________________

__________________
Laptop spec: ASUS X53E, i5 2430m 2.4ghz, 3gb ram, 320gb hdd, intel hd graphics, usb 3.0
dude_se is offline   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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off



All times are GMT -5. The time now is 01:51 PM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0