Solved

Avoid form Validation

Posted on 1998-02-13
4
170 Views
Last Modified: 2010-05-18
I would like  this script to work without the validation. So that when the user has finished entering the line and press return the url is launched. Like the second script that do just that but doesn't work on Internet explorer 3.The first one does.

Here is the jump script and form.(This one works on every browser)


<SCRIPT LANGUAGE="JavaScript">
<!-- JavaScript begins...
function jump (page) {
if(page.substring(0,7)!="http://")page = "http://" + page
      window.location = page;
}
// JavaScript ends -->
</SCRIPT>


<FORM NAME="URLframe">
    <TABLE BORDER="0" ALIGN="CENTER">
      <TR>
        <TD VALIGN="MIDDLE" ALIGN="CENTER" WIDTH="607"><FONT SIZE="3" COLOR="#000000" FACE="VERANDA,ARIAL,HELVETICA"><B>http://</B></FONT><INPUT TYPE="TEXT" NAME="Dest" SIZE="35" MAXLENGTH="50"></TD>
      </TR>
      <TR>
        <TD ALIGN="CENTER" WIDTH="607">
        <P><A HREF="JavaScript:jump(document.URLframe.Dest.value)"><IMG SRC="icons/gob.gif" BORDER="0" HEIGHT="20" WIDTH="60" ALT="GO Button"></A></P></TD>
      </TR>
    </TABLE></FORM>

Here is the script that work on Netscape only and perform the validation by return.

<SCRIPT LANGUAGE="JavaScript">
<!--start stealth

 function GoToURL(j) {
  window.status=('Connecting....')
 
var URLis;
 URLis = document.URLframe.Dest.value
 
   if (URLis == "" || URLis.length <= 8)
           {
     j.value = "Try Again"
      alert('\nOops!\n\nYou must enter a valid URL');
         window.status=('Missing data or Invalid. Try again?.')
           }
    else
        {
 j.value = "Connecting to: http:\\" + URLis  
 var location=("http://" + URLis);
        this.location.href = location;

window.status=('Connecting to ' + URLis + '  Please wait........');
        }
        }
 //-->
</SCRIPT>

<FORM NAME="URLframe"
    ONSUBMIT="GoToURL(document.URLframe.Dest.value);return false;">
    <INPUT TYPE="text" NAME="Dest" SIZE="12" MAXLENGTH="50"></FORM>

Thank you for your help.
0
Comment
Question by:jeffos
[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
  • 2
4 Comments
 
LVL 5

Expert Comment

by:Christian_Wenz
ID: 1278227
I don't quite understand your question - why doesn't it work with IE?

And: how about commenting the validation code (putting a /* before the j.value = ... and a */ after the ...Try again?')  ?
0
 
LVL 10

Accepted Solution

by:
kollegov earned 80 total points
ID: 1278228
The second script don't work in Mie3 due to use of
window.location.href
(href not supported by MIE3)
use
window.location instead.

so it should be something like this:

function GoToURL(j) {
window.status=('Connecting....')
var URLis;
URLis = document.URLframe.Dest.value
if(URLis.indexOf("http://")!=0) URLis="http://"+URLis;
j.value = "Connecting to: " + URLis
window.location = URLis;

window.status=('Connecting to: ' + URLis + ' Please wait........');
}


0
 

Author Comment

by:jeffos
ID: 1278229
thanks a lot.
0
 

Author Comment

by:jeffos
ID: 1278230
thanks a lot.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Suggested Solutions

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 will give core knowledge of JavaScript and will head in to your first JavaScript program. I am Durvesh Naik and I am here to deal with this series of JavaScript. I will teach you JavaScript in part wise , as its quite boring to read big…
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…

752 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