Solved

Go to button

Posted on 2011-09-20
11
491 Views
Last Modified: 2012-05-12
I am having users type in a url in a text box... When a user clicks a button, the users will go to the site entered into the test box... Here is part of the code:

     <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" value="Type a URL here" onfocus="clearDefault(this);this.className='bodytext';"                

                disabled="disabled" 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 );" disabled="disabled" class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>

              </td>
           </tr>
         </table>
      </form>
0
Comment
Question by:axl13
  • 7
  • 4
11 Comments
 
LVL 82

Accepted Solution

by:
leakim971 earned 500 total points
Comment Utility
try : http://jsfiddle.net/XXw7M/
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);                 }
}

Open in new window

0
 

Author Comment

by:axl13
Comment Utility
Where whould I enter this code... And am I already calling it...
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
put this in the head section :

<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>

Open in new window

0
 

Author Comment

by:axl13
Comment Utility
Does not do anything,,, I am not able to type anything in the test box
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
did you try the test page?
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

Author Comment

by:axl13
Comment Utility
from http://jsfiddle.net/XXw7M/

yes, it still did not work
0
 

Author Comment

by:axl13
Comment Utility
Here is the entire file:


<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="https://email.health.state.ny.us/workplace/access/exec/direct" 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" value="Type a URL here" onfocus="clearDefault(this);this.className='bodytext';"                

                disabled="disabled" 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 );" disabled="disabled" class="gobutton">
               </td>
               <td valign="middle" style="padding-bottom: 3px;" nowrap>

              </td>
           </tr>
         </table>
      </form>


    </BODY>
</HTML>
0
 
LVL 82

Expert Comment

by:leakim971
Comment Utility
>from http://jsfiddle.net/XXw7M/
>yes, it still did not work

it work for me :
leakim971-501777.flv
0
 

Author Comment

by:axl13
Comment Utility
I keep getting:


The address is not valid...

I type http://www.google.com
0
 

Author Comment

by:axl13
Comment Utility
FYI,

IT works... Thanks
0
 

Author Closing Comment

by:axl13
Comment Utility
Fast responds... Thanks
0

Featured Post

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this.Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it is …
Imagine a situation that you have installed SSL (http://en.wikipedia.org/wiki/Secure_Sockets_Layer) Certificate on your Cisco ASA (Cisco Adaptive Security Appliance) firewall. Installation of SSL certificate on ASA is an another topic for which you …
In this tutorial viewers will learn how to style transparent/translucent elements using alpha transparency in CSS Start with a normal styled element, such as a div.: Define its "background-color" property as "rgba (255, 255, 255, .5): The numbers in…
In this tutorial viewers will learn how to code links for mobile sites that, once clicked, send a call or text to a specified number. For a telephone link (once clicked, calls a number), begin with a normal "<a href=" link tag. For the href, specify…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now