Solved

Javascript function problem

Posted on 2013-12-04
3
330 Views
Last Modified: 2013-12-04
I have a page with two identical JS functions, go1() and go2(). The first one works correctly, but the second does not display the corresponding dropdown. I can't see what could be causing this. Could somebody let me know if they see the problem?

<script language="JavaScript" type="text/javascript">
function go1(){
if (document.selecter1.select2.options[document.selecter1.select2.selectedIndex].value != "none") {
location = document.selecter1.select2.options[document.selecter1.select2.selectedIndex].value
             }
     }
</script>
<script language="JavaScript" type="text/javascript">
function go2(){
if (document.selecter3.select4.options[document.selecter3.select4.selectedIndex].value != "none") {
location = document.selecter3.select4.options[document.selecter3.select4.selectedIndex].value
             }
     }
</script>
</head>
<body>
<p>&nbsp;<p>&nbsp;<p>&nbsp;
<center><H1><font face="Arial, Helvetica">Page Name/font></H1></center><p>
<p><p><p>
<table align=center width="15%" border=0>
  <tr>
    <td>
<script language="JavaScript" type="text/javascript">
<!--
document.write('<form name="selecter1"><select name="select2"');
document.write('<option value=none>--Select High Level View--');
document.write('<option value=filename.html>Name of Page');
document.write('</select>');
document.write('<input type=button value=Go onclick=go1()>');
document.write('</form>');
// end hiding contents -->
</script>
    </td>
  </tr>
  <tr>
    <td>
<script language="JavaScript" type="text/javascript">
<!--
document.write('<form name="selecter3"><select name="select4"');
document.write('<option value=none>--Select Filter--');
document.write('<option value=aip_filename.html>Page Name');
document.write('<input type=button value=Go onclick=go2()>');
'document.write('</form>');
// end hiding contents -->
</script>
</td>
</tr>
</table>

Open in new window

0
Comment
Question by:dgmoore1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 9

Accepted Solution

by:
Trenton Knew earned 250 total points
ID: 39696639
Line 43.... delete the apostrophe at the beginning.  your closing form tag is being commented out.
0
 
LVL 20

Assisted Solution

by:n2fc
n2fc earned 250 total points
ID: 39696640
Get rid of the extra ' at the beginning of line 43 above
0
 

Author Closing Comment

by:dgmoore1
ID: 39696755
My  eyes are getting too old for this! You're both exactly right - thanks a lot
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've been trying to accomplish this for a while and it just struck me yesterday how to accomplish this task. I have done searches all over the internet looking for ways to email pages from my applications and finally I have done it!!! Every single s…
This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question