HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
"Enter password" form to redirect to one of two pa
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form
View previous topic :: View next topic  
Author Message
olgagoldberg



Joined: 16 Jul 2008
Posts: 1

PostPosted: Wed Jul 16, 2008 1:13 pm     "Enter password" form to redirect to one of two pa Reply with quote

Hey, everyone!

Need help badly with an easy thing:

I need an "enter password" form. There's one password. If they enter it right - they get redirected to one page. If they enter it wrong - they get redirected to another page. There's absolutelly nothing else I need from this form, I'm just scaring away unauthorized visitors.

I'm totally ignorant at this form business, so I would really appreciate it if you would just give me the entire code, from <form> to </form>, leaving blanks for password and two URLs, and spelling out where these blanks are, so I can fill them out.

Thank you very much!

Olga Goldberg

PS: if it matters: site is in php, I work in NotePad, and there's no other forms on the page.
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Fri Jul 18, 2008 7:07 am     Reply with quote

Hi Olga!
I was lacking on this Forum for several days/weeks, since I was finding it down.
So, this is the very first post from me, here now again.
Give it a try:


Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>olgagoldberg</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<script type="text/javascript">

function redirect() {
if (document.goldform.bergtext.value=="olga") {
 document.location.href="http://www.htmlcodetutorial.com/help/ftopic11895.html";
 } else {
 document.location.href="http://www.google.com";
 };
 }
</script>

<style type="text/css">
. {
 }
</style>

</head>
<body bgcolor="#ffa080" text="#ffffff">

<div align="center">

<form name="goldform">
<br /><br />
<b>Enter password:</b>
<input name="bergtext" type="text" size="" style="background-color:#ffffaa; font-family:; font-size:; color:;" />
<br /><br />
<input type="button" size="" value="submit  password" onClick='redirect()' style="background-color:#aaaaff;" />

</form>

</div>


</body>
</html>



The password it is set for, is: olga
(case-sensitive; Olga does not work)
and You get htmlcodetutorial.com 's page on this thread.
Otherwise, with wrong password or empty field, You get google.com.


Simply add:
onLoad='document.goldform.bergtext.focus();'
in BODY tag, if You want the User not to have to left-click manually on the field to get it ready for writing:
User will find the prompt blinking in that field already.

In case User leaves the text-field as empty (nothing entering) and goes submitting, if You wish a warning pop-up message to appear, complete the function as below:


function redirect() {
if (document.goldform.bergtext.value=="olga") {
document.location.href="http://www.htmlcodetutorial.com/help/ftopic11895.html";
} else
if (document.goldform.bergtext.value=="") {
alert('please, enter valid password');
} else
{
document.location.href="http://www.google.com";
};
}




Everythings above work great, even though this is not the state-of-art in password-protecting a web-site section: unauthorized visitors still can descover the password You set, as it is written in the document itself.
They can do "View Page Source" or "HTML" (if IExplorer) by right-mouse clicking on the displayed page (free area somewhere).

This is a client-side-only way to do.
To get the more safety, You have to work out a server-side password-protecting programming, instead.
gosy



Joined: 27 Jul 2008
Posts: 4

PostPosted: Sun Jul 27, 2008 1:47 pm     Reply with quote

Hey Straystudio, really nice code there, i took this and i'm currently using it, thou i got a question for you. Like the script says, when u type in "olga" it sends you to the redirected .html u want to. is it possible to change the code abit so when you type in DIFFERENT word it send you to another .html ?

E.g - When i type "olga" it send me to home.html
and when i type in "private" it sends me to private.html

Thanks in advance, and sorry olga to making a post in you're topic that has nothing to do with you Sad
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Sun Jul 27, 2008 5:29 pm     client-side "Enter password" box Code Reply with quote

 
It does have way much to do, instead; further a step worth to be developed.
Surely Olga agrees.
Besides, it is pleasure with me meeting someone appreciating my layouts.

More if(){}else statement steps can be easily added along the "staircase":



function redirect() {

  if (document.goldform.bergtext.value=="
olga") {
    document.location.href="http://www.htmlcodetutorial.com/help/ftopic11895.html";
    } else
  if (document.goldform.bergtext.value=="
private") {
    document.location.href="http://www.cbox.ws/";
    } else

  if (document.goldform.bergtext.value=="
heinz") {
    document.location.href="http://www.yahoo.com/";
    } else

//  if (document.goldform.bergtext.value=="") {
//    alert('please, enter valid password');
//    } else

                  {
    document.location.href="http://www.google.com/"; // free page
    };

}




Of course, You can change each word in red on You own;
goldform.bergtext as names of FORM and Text INPUT Elements, as well
( in naming: no empty spaces;  _  the only punctuation ).

If User enters no password or an invalid casually one, gets a free page (google as example, here; it may be any with kind of instructions, as well). Nothing happens, instead if the very last command string:

document.location.href="http://www.google.com/"; // free page

becomes deleted, or disabled by placing   //   before; User using the password-box improperly, will not be taken away from the current page (no reaction).

If You remove those three couples of // from left side, the blue-ish statement also enters in play: the User going to submit a blank password-field, will be reminded He/She has to enter a password, by getting warning message; and if only He/She enters valid passwords can proceed in the navigation towards reserved pages.
The very last "stair" redirecting to a free-password page (google), will be reached in case User enters a wrong password, instead.

In JS, two slashes at the beginning (or in any point) of a row, act likewise   <!-- text -->   comments in HTML: as starting from where "//" is, that row of JavaScript will stop from beeing processed.
So, this can be a note at the end of a row:   // free page


I'll keep posting: there is a trick to make the password typed in the SCRIPT as less recognizable by anyone inspecting the HTML Source.

 
gosy



Joined: 27 Jul 2008
Posts: 4

PostPosted: Sun Jul 27, 2008 11:31 pm     Reply with quote

Thank you very much Straystudio, greatly appriciated for your help here, it helped me alot, and i'm learning really basics of javaScript now Smile
gosy



Joined: 27 Jul 2008
Posts: 4

PostPosted: Tue Jul 29, 2008 7:37 am     Reply with quote

Yeah again,
tried this
Code:
onLoad='document.goldform.bergtext.focus();'


put it between the <body> tags but didn't work, instead it was writed in the html like normal text :s

Thanks in advance
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Tue Jul 29, 2008 3:23 pm     Reply with quote

Not between the <body> tags, in BODY tag (opening tag):
Code:
<body bgcolor="#ffa080" text="#ffffff"  onLoad='document.goldform.bergtext.focus();'>
onLoad command acts once page has completed downloading, and the text-field exists, to take focus.
Processing runs as We read the Document: from top to bottom.

Now an other interesting work around for building an Access Page.
I added a counter, here: after given times (customizable) of attempts entering wrong passwords, User gets, besides wrong-password-entered warning messages, an "Access Denied!" displaying as part of the page itself; and the to-submit gear, gets disabled.

User had to refresh page to can re-start, though the scaring effect looks good toward unwished visitors.
Code:

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Acces Page</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />


<script type="text/javascript">

var allowed_attempts = 3 // times allowed before blocking

    var facing = 0
    var exam = false
   
function redirect() {
   
    var pick = facing +1
   
if (document.goldform.bergtext.value=="olga") {
 document.location.href="http://www.htmlcodetutorial.com/help/ftopic11895.html";
 facing = 0; exam = true;
 } else
if (document.goldform.bergtext.value=="heinz") {
 document.location.href="http://www.yahoo.com/";
 facing = 0; exam = true;
 } else
if (document.goldform.bergtext.value=="private") {
 document.location.href="http://www.cbox.ws/";
 facing = 0; exam = true;
 } else
if (document.goldform.bergtext.value=="") {
 alert('please, enter valid password');
 document.goldform.bergtext.focus();
 facing = pick; exam = false;
 } else
        {
 alert('invalid password entered !');
 document.goldform.bergtext.value="";
 document.goldform.bergtext.focus();
 facing = pick; exam = false;
 };
//
if (pick >= allowed_attempts && exam == false) {
 document.goldform.deliver.disabled="disabled";
 document.goldform.bergtext.disabled="disabled";
 document.getElementById("denied").style.display="block";
 } else {
// do nothing
 };

}
 
</script>

</head>
<body bgcolor="#777777" text="#ffffff" onLoad='document.goldform.bergtext.focus();'>


<table height="100%" border="0" width="100%"><tr>
 <td align="left">
 
 <table border="0" cellpadding="16"><tr>
  <td bgcolor="#444440">
  </td>
  <td bgcolor="#444440" align="center">
   <span style="font-family: Courier New, Monospace; font-size:32px;"><b>Straystudio - <i>Photography</i></b><br /><small>in La Spezia - Italy</small><br />
   <div align="right" style="font-size: 12px;"><br />
    <input onClick='contact()' type="button" value="contact us"
     style="background-color:#444440; color:#ffffff; border: 0px; font-family: Courier New, Monospace, serif; letter-spacing: 2px; padding: ; font-weight: bold;" />
   </div></span>
  </td>
  <td bgcolor="#444440" align="center" valign="middle"><noscript>
   <span style="background-color:#efef00; color: #0000ff; font-family: Verdana, Helvetica, Arial, sans-serif; font-size:16px;"><b><i><big>&#160;You
    have JavaScript turned OFF&#160;</big><br />&#160;Please, enable JavaScript on Your Browser setting to run this site.&#160;</i></b>
   </span></noscript>
  </td></tr>
 </table>
 
 </td>
 </tr><tr>
 <td height="100%" align="center" valign="middle">
 
  <form name="goldform">
  <table border="0"><tr>
   <td bgcolor="" align="center">
    <span style="font-family: Helvetica, Arial; font-size:16px;">
    <br /><br />
    <b>Enter password:</b>
    <br /><br />
    <input name="bergtext" type="text" size="" style="background-color:#ffffaa; color: #0000ff; font-family:; font-size:14px; padding-left: 14px;" />
    <br /><br />
    </span>
    <input name="deliver" type="button" size="" value="ENTER  SITE" onClick='redirect()'
     style="background-color:#000040; color:#ffffff; font-family: Verdana, Helvetica, Arial, sans-serif; font-size: 16px; font-weight: bold; letter-spacing: 2px; padding: 6px;" />
   </td>
   </tr><tr>
   <td height="60px" align="center" valign="middle">
    <div id="denied" style="background-color:#000040; display: none;">
    <span style="font-family: Helvetica, Arial; font-size:26px; letter-spacing: 2px; color: #ff0000;"><b>&#160;DENIED ACCESS !&#160;</b></span>
    </div>
   </td></tr>
  </table>
  </form>
 
 </td>
 </tr><tr>
 <td>
 
  <hr color="#444440" size="6px" width="15%" align="right" />
  <hr color="#444440" size="6px" width="25%" align="right" />
  <hr color="#444440" size="6px" width="45%" align="right" />
 
 </td></tr>
 </table>


</body>
</html>


a NOSCRIPT tag enters in play if Visitor's Browser-setting keeps JavaScript disabled.

You can quickly have the Code processed for testing, at here:

  http://htmledit.squarefree.com/

 
gosy



Joined: 27 Jul 2008
Posts: 4

PostPosted: Wed Jul 30, 2008 12:46 am     Reply with quote

Working now! Big thx 2 you Straystudio!! ur my biggest fan here @ this forums atm!
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Sat Aug 02, 2008 5:37 am     Some tips and a more safe method. Reply with quote

 
As promised, a few tips about how to camouflage password and URL among the Code.

( Once again I remind the Reader, a Visitor beeing skilled enough does can carry out both the password or the redirecting URL directly, by viewing page code source.

- PC
through "
View" on menù bar at the very top of the window, a menù opens,
same by right-clicking on an inactive area of the page, then:
    - with Internet Explorer, select
HTML/Source;
    - with Netscape Navigator, select
View Page Source.

- MAC
    - with Safari, from "
View" on menù bar, select View Source. )


In JavaScript, You can fix a service word translating into an integer or a string.
More words can be chained by + sign.
So, say password is private22, You can write:


function redirect() {

   
red='2'; blue='va'; green='2';
   
sal='te';pet='pri';

    if (document.goldform.bergtext.value==
pet+blue+sal+green+red) {
    document.location.href="http://www.htmlcodetutorial.com";
  }  else
              {
    document.location.href="http://www.google.com";
  };
}


If service-words have to connect with true-typed portions, couples of apostrophos or quotes enter in play as delimiters of the not-coded stretch(s); so, still the same private22 may as well render as:

    red='2'; blue='va'; green='2';
    pet='pri';
    if (document.goldform.bergtext.value==
pet+blue+'te'+green+red) {

where te has not been translated.


Done the same on the URL, every details will result no longer so much ready under the first sight of anyone inspecting the Code; more knowledge and patience will be required from the inspector.

The redirecting function, differently named, could as well be entered in larger a SCRIPT handling anything else (or nothing: a fake SCRIPT), staying hidden as mixed among a bunch of JS stuff.

Those service-words bringing pieces of row, can even spread along the large SCRIPT there and here toward the top; still not inside other functions, yet. More hard to find them, so.

Moreover, You can take the whole SCRIPT off away from the Document; in place of it, put the Tag:
Code:
<script type="text/javascript" src="Directory/fake_filename.js"></script>

calling the SCRIPT in play from another location.
The whole SCRIPT, but the
<script type="text/javascript">

</script>

opening and closing Tags, must be saved with .js extension in the same Folder where the master page itself is located, or in any other Folder You wish; the above sample shows it as saved in a sub-Folder.



Even a more safe JS method to password-protect an URL.

Since the + plus sign used as chaining operator has been introduced, now I'll be explaining further an interesting way possible to do, where the password is the same as file-name. Here, + chaining is employed to accomplish URL; simply change in the above samples, redirect() function into this, nothing else to modify in the BODY:



 function redirect() {
   
    var
which = document.goldform.bergtext.value;
   
    document.location.href='http://www.yourdomain.com/
'+which+'.html';
 
 };


Name the file of the page You want to keep private, as (say) filename.html
well, filename will be the password the User has to enter in the text-field to get redirected to that URL.

The good with this way is that, the password isn't written stored in any place in the access page: an intruder inspecting the page source from their computer, can't find the password anywhere.

No needing to duplicate the "stair" for more password/URL combo: a single one serves at all.

It is not possible without paying on lack of safety, yet to have redirection to an alternate page in case User enters wrong password, as the original poster "Olga" was intended to do.
That would require to disclose the password in an if statement; so, turning back to the previous circumstances.

One "on usage" differences between the methods:
Think the case You want certain an User no longer to be allowed after a given time: Your job with them has gladly concluded, but You fear that password and URL as stored somewhere out there, might end in unauthorized hand.
With this method, changing the password means renaming the file; if more Users, each one needs to be contacted and supplied with the new term.
With the former method, instead You can rename the file also revising the Code-URL inside Access Page, then once deleted that User's password, the others can continue using their passwords as before.
_________________________________________________________________________________________




More can be done on the side of the password-protected page itself.


- Hiding the Document from Web Search Engines.

Be aware, all what both the JS password-protect methods above can do, is to let or not to let know an URL to the people (to the User's computer).
Once anyone gets and keeps (Bookmarks) it, He would be able to open that page without having to pass through Access Page.

Moreover, that page always stays available on Internet; so, it might be found by a google search.
So, first thing to do, is to take that page off from engines' searchs;
place this META Tag between <head> </head> tags:
Code:
<meta name="robots" content="noindex, nofollow">


and do not use any
<meta name="keywords" content="">
<meta name="description" content="">
tags offering goods to search engines to find Your Document.

Generally, sites do not share any index of pages that given site is composed of; if You do not let anyone know how Your private file is named on the Web, they will not be able to access it.
www.blogger.com instead as example, does share, under User's Profile, a list of all the Blogs an User keeps opened with them.
In this case, having private pages under an UserName else is way advised.


- Making the page not displaying.
Wrap the whole BODY content with a DIV style="display: none;" as here:
Code:
</head>
<body bgcolor="#777777" text="#ffffff">

  <div id="hider" style="display: none;">
 
     MAIN CONTENT
 
  </div>

</body>
</html>


As a result, the Surfer accessing this Document directly finds it as a blank page.
What can be done, now.
Thanks to:

  document.referrer

the location the Surfer is coming from, can be detected. And if only, Visitor has reached this private page through Access Page, a SCRIPT will be turning display style-property value, from none to block.
That makes the page viewable again.
Here the SCRIPT:

function comingFrom() {

    if (document.referrer=="
http://www.yourdomain.com/AccessPageLocation.html") {
    document.getElementById("
hider").style.display="block";
  }  else
              {
    // do nothing;
  };
}



( I'll keep editing this message ).


 
greenhorn



Joined: 11 Aug 2008
Posts: 2

PostPosted: Mon Aug 11, 2008 10:41 am     More password help please? Reply with quote

Straystudio,
Thanks for all of the info you've supplied. And I know that you're very knowledgable, so I have two questions related to passwords...

1) How could I mask the password when it's keyed in?

For example, when I type in the password, I don't want it to spell out the password, instead I would like to see '********'.

And, 2) After entering the password, when I click the Back button, my password remains in the box. How can it get it to go away so the user has to rekey it after navagating back to the login page?

You've been a big help so far and I like your way of explaining the html code so I didn't want to post my question anywhere else.

Thanks!
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Tue Aug 12, 2008 1:15 am     <INPUT TYPE="password" /> Reply with quote

I had to refer to this option, too; pretty wished, indeed.
So, I'll do it now more completely.

Simply changing Value of TYPE from "text" into "password" in the INPUT field You wish, does the trick already solving both the questions.
It can be used to mask any text-field else as well, than intended for password purpose.

Code:
<input name="bergtext" type="password" />


Often tutorials forget to report this kind of TYPE; so, it is a less known one.
It still keep to be an actual text-field INPUT also taking all the Attributes size="" maxlength="" style="" and so You gave it; except that any typed character is displayed as *
Even if You copy/paste it into some area else, You get ***** (with Netscape Browsers; bullets with IExplorer 7).

And yes, also if going Back with Browser button after submitting, what typed-in will be no longer available.
I shall test this turn-back case on different Browsers more, though I think to find the same behaviour with all.


One more way to achieve the 2nd aim, is to leave that text-field as empty once submitting has gone.
And of course this works with both the "text" and the "password" types.


function redirect() {

if (document.goldform.bergtext.value=="
olga") {
  document.location.href="http://www.htmlcodetutorial.com/";
  document.goldform.bergtext.value="";
  } else
              {
  document.location.href="http://www.google.com/";
  // bold string should repeat at here
  };

}


The executable string clearing text-field content:

document.goldform.bergtext.value = ""

as placed right after the redirecting string(s) still finds its time to act before access-page desappears.
( It can be taken as a further guarantee with "password" type, too if We won't be sure on all Browsers' push-Back clearing ).
The above executable string could as well be replaced by this,
turning the   input type="text"   into   input type="password"   on the while of submitting:

document.goldform.bergtext.type = "password"

since pushing Back, the field gets blank, the new text going to be typed no longer camouflaged, though.


These turn into being a good work-around to leave a cleared field back, with "text" type.
Say the case You have two fields, one for username to display as clear (You have to stay at TYPE="text"),
and one for password to display as masked.

So, I'll be moreover introducing a two-fields password-protected layout as a further development, these methods allow to do.



Enter   Username
Enter   Password
                                                        FORM



In the SCRIPT:

function redirect() {

if (document.goldform.bergtext
USRN.value=="justme" && document.goldform.bergtextPSSW.value=="olga") {
  document.location.href="http://www.htmlcodetutorial.com/";
  document.goldform.bergtext
USRN.value="";
  } else
              {
  alert ('wrong username or/and password entered \n\n' +
            'redirecting to google');
  document.location.href="http://www.google.com/";
  };

}


In the BODY:

<form name="goldform">

<b>Enter username:</b>
<input name="bergtext
USRN" type="text" />
<br /><br />
<b>Enter password:</b>
<input name="bergtext
PSSW" type="password" />
<br /><br />
<input type="button" value="ENTER" onClick='redirect()' />

</form>




  &&   in JS means both the statements must match; if so only, what between   { }   acts.

  \n   with back-slash I put in the  alert ('')  message, acts likewise  <br />   broken row in HTML;
          the message running on a single row as typed, even though:

      alert ('wrong username or/and password entered \n\n redirecting to google')

Running the SCRIPT Code, JavaScript takes into account its rows to be unbroken and You typing can't casually start a row down anywhere likewise in HTML.
To actually apply carriage-return with the Editor on an row which would stay intact,

  +   sign used as chaining operator once again helps;
  ' '   couples of apostrophos still delimiting stretchs.


I have gladly employed this in a couple of Pro-Photographers' Sites, where in the "Wedding" page besides the shared sample images, there is a small box at top right corner, where their customers can access a private page showing some pictures from their own wedding only.



The filename-password method also enters in play.


Combinig two methods may be worth to gain on safety; depending on which behaviours Programmer wants the FORM to do. So:
- the disclosing-code method, still handling username;
- the filename-password method, taking password field.

Nothing changing in the BODY, the function becomes alike:

In the SCRIPT:

function redirect() {

  var
which = document.goldform.bergtextPSSW.value;

if (document.goldform.bergtext
USRN.value=="justme") {
  document.location.href='http://www.your.com/
'+which+'.html'; // re-building URL
  document.goldform.bergtext
USRN.value="";
  } else
              {
  // do nothing;
  };

}


With this combo I would be able to redirect to alternate page in case of wrong username entered, since username (justme) is embeded in the Code to compare.
I would not in case of wrong password entered, instead as I had to disclose it in the Code. In case of wrong password with right username, window goes redirected to an unknown/unreal URL.
An hybrid behaviour, as a result.
Same with alert message for wrong username/password entered.

I do can make a pop-up alert for empty field, instead; with no conflict:


function redirect() {

  var
which = document.goldform.bergtextPSSW.value;

if (document.goldform.bergtextUSRN.value=="") {
  alert ('Please, enter a valid username');
  document.goldform.bergtextUSRN.focus();
  } else
if (document.goldform.bergtextPSSW.value=="") {
  alert ('Please, enter a valid password');
  document.goldform.bergtextPSSW.focus();
  } else
if (document.goldform.bergtextUSRN.value!="
justme") {
  document.goldform.bergtextUSRN.value="";
  document.goldform.bergtextUSRN.focus();
  } else

if (document.goldform.bergtext
USRN.value=="justme") {
  document.location.href='http://www.your.com/
'+which+'.html'; // re-building URL
  document.goldform.bergtext
USRN.value="";
  } else
              {
  // do nothing;
  };

}


Here, if submitting FORM with wrong username, username field auto-clears; in place of a fooling no-reaction.

  !="justme"
  !=   means: not-equal



 
Mr_S



Joined: 02 Nov 2008
Posts: 2

PostPosted: Sun Nov 02, 2008 2:07 am     Reply with quote

Hi and thanks for all the information you've provided here, i've found it very usefull, I have used your code to some degree in my website design but am having trouble with one element.

I have the text input box in one frame but want the redirect to happen to a different frame on the same layout.

Is this easy to achieve?

it needs to effect a frame called "mainFrame"

the script as it is now looks like this and works fine but in the frame that the input box is in.

<script type="text/javascript">

function redirect() {
if (document.goldform.bergtext.value=="gordon") {
document.location.href="Gordon and Nancy/index.htm";
} else
if (document.goldform.bergtext.value=="roger") {
document.location.href="Roger & Sarah/index.htm";
} else
if (document.goldform.bergtext.value=="rose") {
document.location.href="Rose Clarke/index.htm";
} else
if (document.goldform.bergtext.value=="jo") {
document.location.href="Jo & Martin/index.htm";
} else
if (document.goldform.bergtext.value=="black") {
document.location.href="Black Knights/index.htm";
} else
if (document.goldform.bergtext.value=="harry") {
document.location.href="Harry's Christening/index.htm";
} else
{
// do nothing
};
}
</script>
Straystudio



Joined: 14 Apr 2008
Posts: 264
Location: Nord Italy

PostPosted: Mon Nov 03, 2008 2:07 am     Delivering password-protected document, to an IFRAME. Reply with quote

 
What defines what an IFRAME loads, is the Path/URL entered as Value in its SRC Attribute.
JavaScript is well known to be able making the Value changing job.
So, make changes according to this sample:


To send from the master Document to an IFRAME:

if (document.goldform.bergtext.value=="roger") {
document.
getElementById("secondFr").src="Roger_and_Sarah/index.htm";
}


To send jumping from an IFRAME to anothers, both them carryed by the master Document, simply code as:

parent.document.getElementById("secondFr").src="Roger_and_Sarah/index.htm";


also giving that IFRAME an ID :

<iframe
id="secondFr" src="http://www.google.com/"></iframe>


I won't be sure to recognize an IFRAME as a FORM Element via NAME (it would be likewise   document.goldform.secondFr.src=""   or so), then I suggest   getElementById("")   as a reliable method, good since the IE5 age (latest 90's), and on every Browser, now.

Be aware, to one day You'll be handling audio/video files, the same can NOT be achieved with OBJECT and EMBED Elements to turn their SRC Value.
  innerHTML   shall be used, instead changing the whole string;   document.write   in certain cases, as well.


You should have no problem with empty spaces in Path/URL, with current Browsers; I replaced with _ underscore, though.
 
Mr_S



Joined: 02 Nov 2008
Posts: 2

PostPosted: Mon Nov 03, 2008 12:12 pm     Reply with quote

Thanks for that I will try and use that now.

Also how do I adjust the code so that when text is typed into the text box it can be submitted by pressing return on the keyboard or the submit button?

Thanks
gussww



Joined: 22 Sep 2008
Posts: 34

PostPosted: Tue Nov 04, 2008 2:20 am     test software Reply with quote

Ftp Download! Cracked Software/software Cracks/dongle Cracks/warez Cd Cracks/serials! CRACKED SOFTWARE(CAD/CAE/CAM/EDA/PCB/GIS/CNC/FEA)! if you need some softwares, please email me: hunkeratbk.ru

Use Ctrl+F to search the program you need.

IAR Embedded Workbench for Atmel AVR v5.11B FULL
Acad.finewave2003.unix
ACCEL.FPGA.V1.7.0007
Accelerated.Designs.UltraLibrarian.Gold.2.0.82
Plate 'n' Sheet Professional v4.04
RhinoCeros v4.0 SR(x) + RhinoNest plugins
PVE Lite 2007
PVELite 2007
PipeData-PRO
Autoship 8.2.0 full setup
ProSurf & Pilot3D
Sea Solution
VRMesh Design
CALDsoft
SigmaNEST v8
ABB RP570.1 Protocol (RP5) v6.9.23
IEC 870-5-101103 Driver (I87) v7.9.25.0
Link Master version V2.20.108-U
Redundancy Master version 1.10.54-U
CPAC Imaging Professional version 3.0 full setup
GlobalCAD Plantasia 2008 Professional Edition
Smart Folio Professional Edition
Actel.CoreConsole.v1.3
Actel.Designer.v8.3
Actel.Designer.v8.3.Linux
Actel.Libero.IDE.v8.3.Windows
Actel.Designer.v7.2.SPA
Actel.Designer.v7.1
Actel.Libero.IDE.v5.2.Simulation Libraries.Winnt
Actel.Libero.IDE.v5.2.Winnt
Actel.PALACE.V1.1.ALL
Agilent.T.and.P.Toolkit.v1.2.DOT.NET.SUB100
DOWNLOAD
ЗАГРУЗКА
TELECHARGER
ダウンロード
DESCARGA
SPALTEN
SERIELS
CRACK
CRACKED
FISSURES
NUMéRO DE SéRIE
Fendas
NúMERO DE SéRIE
クラック
ひびの入った
ひび割れ
シリアルナンバー
GRIETAS
NUMERO DE SERIE
ΡΗΓΜΑ
Αριθμο? σειρα?
Agilent.Advanced.Design.System.v2008
Agilent.Advanced.Design.System.v2008.Linux
Agilent.Advanced.Design.System.v2006A.Inc.UPDATE2
Agilent.Advanced.Design.System.v2006A.Linux.with.UPDATE1
Agilent.Advanced.Design.System.v2005A.WinXP.2000
Agilent.Advanced.Design.System.v2005A.Linux
Agilent.Advanced.Design.System.v2004A.UNIX
Agilent.Advanced.Design.System.v2004A
Agilent.AppCAD.V3.02
Agilent Electromagnetic Design System
Agilent.Genesys.2008.01
Agilent.GENESYS.2007.03.and.SystemVue.2007.03
Agilent.GENESYS.2007.03
Agilent.GENESYS.2006.v10
Agilent.SystemVue 2006.04
Agilent.HFSS.V5.6
Agilent.IC-CAP.2006
Agilent.IC-CAP.2004
Agilent.IC-CAP.V2002
Agilent.RFDE2006a
Agilent.RFDE2005a
Agilent.RFDE2003C
Agilent.TEST.EXEC.SL.V5
Agilent.TS5500
Agilent.VEE.Pro.v7.5
Agilent.VEE.Pro.v7.5.Addon
Agilent.89600.Series.Vector.Signal.Analyzer.v8.00
Agilent.89600.Series.Vector.Signal.Analyzer.v6.31
Agilent.89600.Series.Vector.Signal.Analyzer 3.01a
ADI.Visual.DSP.v3.50
AdLabPlus.v2.8
Aldec.Active-HDL.v7.2
Aldec.ALINT.v2008.02
Aldec.ALINT.v2008.02.Linux
Aldec.Riviera.v2007.06
Aldec.Riviera.v2007.02.LiNUX
Aldec.Riviera.v2007.02.LiNUX64
Aldec.Active-HDL.v6.3
Aldec.Active-HDL.v6.3 Verilog Libraries Addon
Aldec.Active-HDL.v6.3 VHDL Libraries Addon
Aldec.Active.HDL.v6.3.Xilinx.Schemetic.Libaraies.Addon
Aldec.Riviera.v2004.12.1684.WinNT2kXP
Aldec.Riviera.v2006.02.LiNUX
ALTERA.Quartus.II.v7.2.SP3
Altera.NiosII.7.2.SP3
Altera.Dspbuilder.v7.2.S3
Altera.Megacore.IP.Library.v7.2.SP3
Altera.Modelsim.6.1g.SP3
Altera.Dspbuilder.v5.1
Altera.MAX.PlusII.V10.23
Altera.MegaCore.IP.Library.V6.0
Altera.MegaCore.IP.Library.V5.0
Altera.Nios.Development.Kit.Incl.SOPC.Builder.Ver.2.11.For.Win
Altera.Quartus.II.v6.1.Linux
ALTERA.Quartus.II.v5.1
ALTERA.Quartus.II.v6.0
Altera.Quartus.II.v6.0.Linux
Altium.Designer.6.8
Altium.Designer.6.0
Altium.DXP.2004.SP2
Altium Protel DXP.7.2.92.With.SP3.winNT
Altium.Protel.DXP.Chinese
Altium.P-CAD.v2006.SP1
Altium.P-CAD.v2002
Altium.P-CAD.v2002.SP1
AMTECH.v2006
AMTECH.ProDesign.NEC.v9.2.5
Apsim.2003
ELCAD/AUCOPLAN v7.3.0
AutoTRAX.EDA.v9.20
AutoTRAX.EDA.v3.12
Analog.Devices.VisualDSP.Plus.Plus.v4.5
Analog.Devices.VisualDSP.Plus.Plus.v4.0
Ansoft.HFSS.V11.0
Ansoft Nexxim v4.0
Ansoft.Designer.v3.5
Ansoft.HFSS.V11.0.BETA
Ansoft.PExprt.v6.0.SP5
Ansoft.Q3D.Extractor.v7.0
Ansoft.Simplorer.v7.0.1.SP5
Ansoft.Designer.v3.0
Ansoft.Designer.and.Nexxim.v2.2.0
Ansoft.Designer.v2.0
Ansoft.Ensemble v8.0.sub100
Ansoft.Ephysics v1.0
Ansoft.HFSS.V10.0
Ansoft.HFSS.v9.2
Ansoft.Scap.v5.5
Ansoft.Link 3.0
Ansoft.Maxwell.2D.Version.8.&.3D.V6
Ansoft.Maxwell.3D.2D.&.RMxprt.v11.1
Ansoft.Maxwell.EM.v10.0
Ansoft.Maxwell.RMxprt.v5.0
Ansoft.Maxwell.Spicelink.v4.5
Ansoft.OPTIMETRICS 2.5
Ansoft.PExprt v5.0
Ansoft.Q3D.Extractor.v7.0
Ansoft.Q3D Extractor V6.0
Ansoft.Simplorer.v6.0
Ansoft.Serenade Design Environment v8.71
Ansoft.SIWave.v3.0
Ansoft.Tpa.Turbo.package.analyzer
AWR.Design.Environment.v7.52.3682
Nuhertz.Filters.v4.1.3
AWR.Testwave.for.AWRDE.v2.04
AWR.Design.Environment.7.0.3055
AWR.Microwave.Office.v2002
AWR.Microwave Office.2004.2537R.v651
AWR.TESTWAVE
AWR.6.01
ARM.ADS1.2
ARM.Firmware.Suit.v1.41
ARM.Developer.Suite.V1.2
ARM.RealView.Developer.Suite.v2.2
Bluecontrol.v.2.5.SR2
Concept.SPICE.VISION.V2.3.6
Concept.spicevision.linux.21
Concept.GATEVISION.V1.7.3.WIN32
CADSoft.Envisionneer.v1.0
CadSoft.Eagle.v4.16r1
Camtastic2000
CIM-TEAM.E3.Series.v2006.550
CIM-TEAM.E3.Series.v2006
Rowley.Associates.CrossWorks.for.ARM.v1.5.Build.2
Rowley.Associates.CrossWorks.for.AVR.v1.3.Build.1
Rowley.Associates.CrossWorks.for.MAXQ.V1.0.Build.2
Rowley.Associates.CrossWorks.for.MSP430.v1.3.Build.3
CSmith.v2.7
CST.Studio.Suite.v2008.SP5
CST.Studio.Suite.v2008.LiNUX
CST.Studio.Suite.v2006
CST.MicroWAVE.Studio.5.0.02.SP2
CST.Design.Studio.v3.0
CST.EM.Studio.v2.0
CST.MAFIA.v4.1
Cadence.Allegro.Design.Workbench.v15.5.Wint
Cadence.Allegro.Silicon.Package.Board.V16.0.WINNT
Cadence.Analog.VoltageStorm.(EANL).v51.linux
Cadence.ASSURA316.Linux
Cadence.ElectronStorm.(ANLS).v6.1
Cadence.Encounter.Timing.System(ETS).v61.Linux
Cadence.FINALE.v61.Linux
Cadence.IC610.Linux
Cadence.IUS58.SP2.linux
Cadence.IPCM.v60.Linux
Cadence.IXE.v50.Linux
Cadence.MMSIM.6.1.for.lnx86
Cadence.MMSIM.6.11.for.lnx86
Cadence.OrCAD.16.0.WINNT
Cadence.Allegro.Silicon.Package.Board.V15.5.1
Cadence.Allegro.Silicon.Package.Board.V15.5.Linux
Cadence.Allegro.Silicon.Package.Board.V15.7.Wint
Cadence.Allegro.Silicon.Package.Board.V15.7.Linux
Cadence.AMS.Methodology.Kit.5.1.Linux
Cadence.ASSURA315.Linux
Cadence.ASSURA315-OA5251.Linux
Cadence.ASSURA315USR1-5141.Linux
Cadence.BSIMProPlus.v5.1
Cadence.IC5141
Cadence.IC5141.USR1
Cadence.IC5141.USR4
Cadence.ICC.11241.USR3.Linux
Cadence.IC.Design.v5.0.Linux 2CD
Cadence.ISV5.4.Linux
Cadence.IUS5.4.linux
Cadence.IXE.50.linux
Cadence.LOGIC.Design.and.Verification(LDV).v5.1.Win&Linux
Cadence.MMSIM.6.0.USR2.for.lnx86
Cadence.Virtuoso.NeoCircuit.v3.4.0.Linux
Cadence.OrCAD.15.7.WINT
Cadence.OrCAD.Suite.With.PSPICE.V10.5
Cadence.QRC.Extraction.(EXT).v52.linux
Cadence.RC.v6.1.Linux
Cadence.RF.Design.Methodology.Kit.Linux
Cadence.SOC.Encounter.v61.USR1.for.lnx86
Cadence.SOC.Encounter.v61.for.lnx86
Cadence.SOC.Encounter.5.2.USR4.for.lnx86
Cadence.Specctra.Router.15.1
Cadence.Specctra.Router.v10.2
Cadence.SPW.4.9.for.linux
Cadence.SPW.4.8.2.for.linux
Cadence.SPW.4.8.1.for.linux
Cadence.Silicon Package Board(SPB) Codesign v15.5.1-ISO 3CD
Cadence.Specman.Elite.V5.0.Linux
Cadence.Specman.Elite.v5.0.Linux64
Cadence.SEV.V412
Cadence.TSI.V61
Cadence.Virtual.Component.Co-design.v2.2
Cadence.VMGR.v14.Linux&Sun4v
Cadence.XAE.v6.1.Linux
CYME.CYMCAP.v4.6.R2
CYME.CYMDIST.v4.7.R6
CYME.CYMGRD.v6.3.R7
CYME.CYMTCC.v4.5.R8
CYME.PSAF.v3.1.R1.11
Compuware.DevPartner.Studio.Professional.v8.1
Compuware.DriverStudio.v3.2
Compuware.QACenter.v4.8
Compuware.Reconcile.v2.0.1.88
Compuware.Trackrecord.v6.2.2.86
Compuware.DriverStudio.v3.1
CoWare.LisaTek.2005.1.1.Linux
CoWare.LisaTek.2005.1.1.Win
CoWare.SPW.5.02.XP
CoWare.SPW.5.XP
CYPRESS.MICROSYSTEMS.PSoC.DESIGNER.INCL.C.COMPILER.V4.2
Denali.Memory.Modeler.v2.9.24.WINNT
Denali.Memory.Modeler.v3.1.067.WINNT
Denali.linux.3.2.008
Dolphin.SMASH.v5.9.2
Dolphin.SMASH.v5.9.2.LINUX
Dolphin.SMASH.v5.9.2.SOLARIS
Dolphin.SoC.GDS.v6.0.1
Dolphin.SoC.GDS.v6.0.1.LINUX
Dolphin.SoC.GDS.v6.0.1.LINUX64
Dolphin.SoC.GDS.v6.0.1.SOLARIS
Dolphin.SoC.GDS.v6.0.1.SOLARIS64
DownStream.CAM350.v9.5.2
DownStream.CAM350.v9.1.1
DownStream.CAM350.V9.1
EAGLEWARE.GENESYS.V2006.04.final
EAGLEWARE.GENESYS.V2003.03.SP3
Eagleware.Genesys.v8.11B
Eagleware.Genesys.v9.2
Electronics.Workbench.Multisim.v9.0.155
Electronics.Workbench.Ultiboard.v9.0.155
Electronics.Workbench.Ultiroute.for.Ultiboard.v9
Emu8086.v3.27m
Engineous.ISIGHT.v8.0
Engineous.ISIGHT-FD.v2.5.5
FEKO.Suite.5.2
Fintronic.Super.Finsim.v9.2.8
Fintronic.Super.FinSim.v9.2.8.Linux
Fintronic.Super.FinSim.v9.2.8.Solaris
Flomerics.Flotherm.v7.1
Flomerics.FloEMC.v6.1
Flomerics.FloEMC.v5.1
FLOMERICS.FLOTHERM.V6.1
Flomerics.flotherm.v5.1
Flomerics.Flopcb.v2.2
Flomerics.Flopcb.v2.1
Flomerics.MicroStripes.v7.0
GHS.MULTI2000.v3.5.ARM 56K
Graphicode.GC-PowerStation.v7.1.4
Graphicode.GC-PowerStation.v6.2.2
Graphicode.GC-PowerStation.v5.2.2
GREEN.HILLS.SOFTWARE.MULTI.FOR.ARM.V4.2.3
GREEN.HILLS.SOFTWARE.MULTI.FOR.MIPS.V4.0
IAR.visualSTATE.v5.4
I-Logix Rhapsody v7.0
I-Logix Statemate v4.1
IMST Empire XCcel 5.15
IMST Empire XCcel 5.0
IMST.Empire.v4.12
IMST.Empire.v4.00
Infolytica.MagNET.v6.11.2
InnovEDA.PowerPCB.with.BlazeRouter.v5.0
InnovEDA.PowerPCB.Suite.5.0
Intusoft.ICAP/4.Windows v8.1.6

Anything you need,must can mail Email: If there is your need, please mail me: hunkeratbk.ru
[/u]
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> HTML Form All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial