SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2000
    Location
    Peterborough, England
    Posts
    50
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Cool

    What is wrong with the script below?

    It is the HTML used for a password window on my site. At present people have to type the password and then click on a button. However, with many other web sites (such as hotmail) you can instead press return or enter if you should desire. I would like to give visitors to my site the opportuntiy the press return or enter.

    the script/HTML coding is:

    <HTML>
    <HEAD>
    <TITLE>Gate Keeper</TITLE>

    <SCRIPT LANGUAGE="JavaScript">
    <!--- Hide from tired old browsers that should be put to pasture.

    ////////////////////////////////////////////////////////////////////
    /// Get your very own Gate Keeper from Professional Web Design ///
    /// http://junior.apk.net/~jbarta/weblinks/gate_keeper/ ///
    ////////////////////////////////////////////////////////////////////

    function goForit() {
    var location;
    var password;
    password=this.document.testform.inputbox.value
    location=password + ".html"
    fetch(location)
    theKeeper=window.close()
    }

    function fetch(location) {
    var root;
    if (opener.closed) {
    root=window.open('','theKeepersGopher','toolbar=yes,location=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=no');
    root.location.href = location;
    } else {
    opener.location.href = location;
    }
    }

    // End hiding --->
    </SCRIPT>

    </HEAD>

    <BODY BACKGROUND="keeper.gif">

    <TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
    <TR>
    <TD ROWSPAN=2 WIDTH=50%>
    &nbsp;&nbsp;

    <TD WIDTH=50% ALIGN=CENTER VALIGN=MIDDLE>
    <FONT FACE="ARIAL" SIZE=2><B>Hold on there buddy. You'll need a password to get in here. We're tryin' to keep out the riff-raff.</B></FONT><BR>
    &nbsp;

    <TR>
    <TD WIDTH=50% ALIGN=CENTER VALIGN=BOTTOM>
    <CENTER>
    <FORM NAME="testform">
    <INPUT TYPE="text" NAME="inputbox" VALUE="" size=20>
    <INPUT TYPE="button" NAME="button" Value="Submit Password" onClick="goForit(this.form)">



    <!--- You can remove the following link if you want.
    I just added it to satisfy my own selfish interests.
    Just remove the following line and this comment. --->
    <P><FONT SIZE=1 FACE="COMIC SANS MS"><A HREF="http://junior.apk.net/~jbarta/weblinks/gate_keeper/" TARGET="_blank"><B>Gate Keeper</B></A></FONT>



    </FORM>
    </CENTER>


    </TABLE>

    </BODY>

    </HTML>


    I am not too good at manipulating HTML, but perhaps someone can help?

    I look forward to your comments,

    MATT.

  2. #2
    Your Lord and Master, Foamy gold trophy Hierophant's Avatar
    Join Date
    Aug 1999
    Location
    Lancaster, Ca. USA
    Posts
    12,305
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Change your type from button to submit and try it.
    Wayne Luke
    ------------



Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •