HTML issue with address bar

When I enter a url in the address section, brings up a page, but does not open the url... When I click the back button, the page redirects to the url I requested... Here is the HTML... Thanks

<! Written by Angelo>

<HTML>
   <HEAD> 
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function() {
             document.getElementsByName("go")[0].onclick = function() {
             alert("going to :" + document.getElementsByName("address")[0].value);
             setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);                 }
           }
      </script> 
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>
      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
	NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>
      <P></P>
      <H2><U>Remote Access Has A New Look</U></H2>
      <P>
        In an effort to increase user experience and to support access from mobile devices (
        ipad, itouce, and iphone), the remote access platform has changed. As a result of this 
        change, users will be required to authenticate twice when logging into Lotus Notes,
        which will be temporary as work is being done to resolve this
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>
         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>
         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 	<form name="directForm" method="post" action="http://" onsubmit="setTarget(this);">

      	  <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
          		 <tr>
          	         <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                       <span class="intranetbodytext" style="">
                          <b>Intranet Address:</b>
                       </span>
                     </td>
                     <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">


                       <input type="text" name="address" maxlength="2082" 
                           style="width: 325px;" class="intranetaddress">

                     </td>
                     <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                      <input type="submit" name="go" value="GO" onclick="submitDirectAccess( this.form );" class="gobutton">
                     </td>
                     <td valign="middle" style="padding-bottom: 3px;" nowrap>
                     </td>
                    </tr>
               </table>
      </form>
    </BODY>
</HTML>

Open in new window


axl13Asked:
Who is Participating?
 
Michel PlungjanConnect With a Mentor IT ExpertCommented:
Here

1. Change the function


function go(theForm) { 
  var val = theForm.address.value; 
  alert("going to :" + val);
  setTimeout(function() { location.href = val }, 200);
  return false; // cancel submit         
}

Open in new window


2. Change the form



<form onsubmit="return go(this)">
        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>
               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082"
                 style="width: 325px;" class="intranetaddress">
               </td>
               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="submit" value="GO"  class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
     </form>

Open in new window

0
 
bartvdCommented:
Are you sure action="http://" is correct? This will not let you go to the same page. Do not use the action attribute for that.
0
 
axl13Author Commented:
Are your meaning:
<form name="directForm" method="post" action="http://" onsubmit="setTarget(this);">

Should I just leave it with ""
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
bartvdCommented:
Yes
0
 
axl13Author Commented:
all that happens now is a reload of the page... Here is an update of the config:

<! Written by Angelo>

<HTML>
   <HEAD> 
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function() {
             document.getElementsByName("go")[0].onclick = function() {
             alert("going to :" + document.getElementsByName("address")[0].value);
             setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);                 }
           }
 	 function clearDefault(w) 
         {
             w.value = "";
         }
         function submitDirectAccess(w) 
         {
             return ture
         }
         function setTarget(w)
         {
             return true;
         }
      </script> 
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>
      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
	NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>
      <P></P>
      <H2><U>Remote Access Has A New Look</U></H2>
      <P>
        In an effort to increase user experience and to support access from mobile devices (
        ipad, itouce, and iphone), the remote access platform has changed. As a result of this 
        change, users will be required to authenticate twice when logging into Lotus Notes,
        which will be temporary as work is being done to resolve this
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>
         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>
         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 <form name="directForm" method="post" action="" onsubmit="setTarget(this);">

        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>
               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082" 
                 style="width: 325px;" class="intranetaddress">
               </td>
               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="submit" name="go" value="GO" onclick="submitDirectAccess( this.form );" class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
      </form>


    </BODY>
</HTML>

Open in new window


0
 
bartvdCommented:
This line: <input type="submit" name="go" value="GO" onclick="submitDirectAccess( this.form );" class="gobutton">

should also be this line:
<input type="button" name="go" value="GO" class="gobutton">

I suppose.
You use javascript to navigate to the other page, so your form should not be submitted. Also, you change your onclick event in a function that does nothing, this has to be removed.
0
 
Michel PlungjanIT ExpertCommented:
What is your aim

You have an
1. onsubmit but
2. an onclick on the submit button (which return ture instead of true, which will likely give an error) but
3. onload of the page you overwrite that onclick

So what do you REALLY want?
0
 
axl13Author Commented:
sorry, what part should be removed...
0
 
axl13Author Commented:
mplungjan:

My aim is the following:

Users remote access to a site with a bunch of link... At the bottom of the screen is a place to enter a url, so a user can go to another intranet site that is not on the list above
0
 
bartvdCommented:
Just replace the lines as i suggested, in this lines the wrong part is removed :)
0
 
axl13Author Commented:
bartvd,

here is my new line:

<input type="button" name="go" value="GO" onclick="submitDirectAccess( this.form );" class="gobutton">
0
 
Michel PlungjanIT ExpertCommented:
No need for

onclick="submitDirectAccess( this.form );
either
0
 
bartvdCommented:
Complete new code, I tested this and it works:

<HTML>
   <HEAD>
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function() {
             document.getElementsByName("go")[0].onclick = go;
           }
        function clearDefault(w)
         {
             w.value = "";
         }
        function go()
		{
		alert("going to :" + document.getElementsByName("address")[0].value);
        setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);            
		}
         function setTarget(w)
         {
             return true;
         }
      </script>
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>
      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
      NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>
      <P></P>
      <H2><U>Remote Access Has A New Look</U></H2>
      <P>
        In an effort to increase user experience and to support access from mobile devices (
        ipad, itouce, and iphone), the remote access platform has changed. As a result of this
        change, users will be required to authenticate twice when logging into Lotus Notes,
        which will be temporary as work is being done to resolve this
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>
         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>
         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 
		<form method="post" action="javascript:go()">
        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>
               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082"
                 style="width: 325px;" class="intranetaddress">
               </td>
               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="button" name="go" value="GO"  class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
		 </form>
      


    </BODY>
</HTML>

Open in new window

0
 
axl13Author Commented:
When I press enter the page does not load... But it does with the go button
0
 
bartvdCommented:
hmm, it does when I tested it. I tested with IE and FF, which browser do you use?
0
 
axl13Author Commented:
I just tried on FF and I get the following:

File NOt FOund

Firefox can't find the file at /C:/Documents and Settingd....

0
 
bartvdCommented:

Can you give me the url you typed in and the complete message?
0
 
axl13Author Commented:
0
 
bartvdCommented:
Ok, I also tested this, it should not give this error anymore.

New code:

<HTML>
   <HEAD>
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function() {
             document.getElementsByName("go")[0].onclick = go;
           }
        function clearDefault(w)
         {
             w.value = "";
         }
function keypressgo(e) {
    if (e.keyCode == 13) {
        go();
        return false;
    }
}

        function go()
            {
            alert("going to :" + document.getElementsByName("address")[0].value);
        setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);            
            }
         function setTarget(w)
         {
             return true;
         }
      </script>
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>
      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
      NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>
      <P></P>
      <H2><U>Remote Access Has A New Look</U></H2>
      <P>
        In an effort to increase user experience and to support access from mobile devices (
        ipad, itouce, and iphone), the remote access platform has changed. As a result of this
        change, users will be required to authenticate twice when logging into Lotus Notes,
        which will be temporary as work is being done to resolve this
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>
         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>
         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 
            
        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>
               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082"
                 style="width: 325px;" class="intranetaddress" onkeypress="return keypressgo(event)">
               </td>
               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="button" name="go" value="GO"  class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
            
     


    </BODY>
</HTML>
0
 
axl13Author Commented:
AM i getting ride of :

  <form method="post" action="javascript()">
0
 
axl13Author Commented:
No go, same error:

<HTML>
   <HEAD>
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function()
           {
             document.getElementsByName("go")[0].onclick = go;
           }
         function clearDefault(w)
           {
             w.value = "";
           }
       function keypressgo(e)
          {
            if (e.keyCode == 13)
            {
               go();
               return flase;
            }
          }
          function go()
            {
                 setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);            
            }
          function setTarget(w)
          {
             return true;
          }
      </script>
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>

      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
      NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>

      <P></P>
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>

         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>

         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 <form method="post" action="javascript()">
        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>

               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082"
                 style="width: 325px;" class="intranetaddress">
               </td>

               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="button" name="go" value="GO" class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
</form>

    </BODY>

</HTML>



0
 
Michel PlungjanIT ExpertCommented:
Pls post CODE in the CODE field or wrap in [ code ] ... [ /code]
0
 
axl13Author Commented:
Sorry
<HTML>
   <HEAD> 
      <TITLE> NYSDOH WorkPlace SSL </TITLE>
      <script>
         window.onload = function() 
           {
             document.getElementsByName("go")[0].onclick = go;
           }
         function clearDefault(w)
           {
             w.value = "";
           }
       function keypressgo(e) 
          {
            if (e.keyCode == 13) 
            {
               go();
               return flase;
            }
          }
          function go()
            {
                 setTimeout(function() { location.href = document.getElementsByName("address")[0].value; }, 200);            
            }
          function setTarget(w)
          {
             return true;
          }
      </script> 
   </HEAD>

   <BODY BGCOLOR="#ececec"><FONT size="3" color="darkblue">
      <P><image SRC="NYSDOH.bmp" width="100%"></P>
      <P ALIGN="LEFT"><B><FONT size="6">Department of Health<BR>

      <FONT size="4"><I>Information for a Healthy New York</I>
      </FONT></B></P>
      </FONT>
      <HR size="5" width="95%">
      <H1 ALIGN="center">NYSDOH WorkPlace</H1>

      <P>
      NYSDOH WorkPlace provides secure access to network resources on your intranet. To
        access a resource, click its name from the list below. For help, email
        help@health.state.ny.us
      </P>

      <P></P>
      </P>
      <P></P>
      <HR size="5" width="95%">
      <P></P>
      <H3><I> Web Bookmarks </I></H3>
      <P></P>
      <P>

         <A href="http://applevip.health.state.ny.us/mailjump.nsf">Notes E-Mail (High-speed connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/mailjump2.nsf">Notes E-Mail (Low-speed connection)</A><BR>      
         <A href="http://applevip.health.state.ny.us/mailjump3.nsf">Notes E-Mail (Ultra-mobile connection)</A><BR>
         <A href="http://applevip.health.state.ny.us/asahomepage.nsf">Browse for a Lotus Notes Database</A><BR>
         <A href="https://latsweb.health.state.ny.us">LATS</A><BR>
         <A href="https://travel.health.state.ny.us">Travel</A><BR>

         <A href="https://password.health.state.ny.us">Enterprise Password</A><BR>
         <A href="https://portal.health.state.ny.us">NYSDOH Intranet Websites</A><BR>
      </P>
      <BR>


 <form method="post" action="javascript()"> 
        <table cellspacing="0" cellpadding="0" border="0" class="addressbar">
           <tr>

               <td valign="middle" style="padding-left: 5px; padding-bottom: 3px;" nowrap>
                   <span class="intranetbodytext" style="">
                       <b>Intranet Address:</b>
                   </span>
               </td>
               <td width="325" style="padding-top: 5px; padding-bottom: 4px;" valign="middle">
           <input type="text" name="address" maxlength="2082" 
                 style="width: 325px;" class="intranetaddress">
               </td>

               <td  style="padding-top: 2px; padding-left: 5px;" valign="middle" nowrap>
                <input type="button" name="go" value="GO" class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>
              </td>
           </tr>
         </table>
</form>

    </BODY>

</HTML>

Open in new window

0
 
bartvdConnect With a Mentor Commented:
Hey, you made a little error changing your code.
With the code you just posted, change line 70 to

<form method="post" action="javascript:go()">

If this does NOT work, remove line 70 and 91. Change line 80 and 81 to this to lines:

<input type="text" name="address" maxlength="2082"
                 style="width: 325px;" class="intranetaddress" onkeypress="return keypressgo(event)">
0
 
Michel PlungjanIT ExpertCommented:
You PPL over complicate things. I'll look tomorrow
0
 
axl13Author Commented:
Thanks
0
All Courses

From novice to tech pro — start learning today.