PC Review


Reply
Thread Tools Rate Thread

Adding a Button to My Web (Password)

 
 
JCO
Guest
Posts: n/a
 
      6th Feb 2004
I want to add a simple Form Field & Push Button so that when selected, will
validate
a field to allow the user to go to the next page or not. Nothing fancy.

I created a separate htm page with a form field:

How do you verify the field (when the button is selected)?
How do you, programmatically with JavaScript's, open the next page or
display a blank page.

Any help on this code (script) is appreciate.


 
Reply With Quote
 
 
 
 
Ronx
Guest
Posts: n/a
 
      6th Feb 2004
See www.rxs-enterprises.com/tests/jspass/
This is more elaborate than you asked for, but is as secure as javascript
page protection can get.

--
Ron
Reply only to group - emails will be deleted unread.


" JCO" <(E-Mail Removed)> wrote in message
newsxPUb.20195$(E-Mail Removed)...
> I want to add a simple Form Field & Push Button so that when selected,

will
> validate
> a field to allow the user to go to the next page or not. Nothing fancy.
>
> I created a separate htm page with a form field:
>
> How do you verify the field (when the button is selected)?
> How do you, programmatically with JavaScript's, open the next page or
> display a blank page.
>
> Any help on this code (script) is appreciate.
>
>



 
Reply With Quote
 
Jim Buyens
Guest
Posts: n/a
 
      6th Feb 2004
>-----Original Message-----
>I want to add a simple Form Field & Push Button so that
>when selected, will validate a field to allow the user to
>go to the next page or not. Nothing fancy.
>
>I created a separate htm page with a form field:
>
>How do you verify the field (when the button is selected)?


First, make sure the button is truly a pushbutton
(type="button") and not a Submit button (type="submit").

Then, add an onclick= atribute as shown below:

<input type="button" onclick="valForm();" value="Next"
name="btnNext">

Finally, add a script such as the following anywhere in
the Web page. (The <head> section is a common choice.)

<script>
function valForm(){
}
</script>

>How do you, programmatically with JavaScript's, open the
>next page ordisplay a blank page.


Inside the fucntion you just created, code whatever tests
you want want, then set window.location.href to the URL of
the next page to display. Here's an example that assumes a
text box named txtName shouldn't be empty.

<script>
function valForm(){
if (document.forms[0].txtName.value == "") {
return 0;
}
document.location.href="nextpage.htm";
}
</script>

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------


 
Reply With Quote
 
Steve Easton
Guest
Posts: n/a
 
      6th Feb 2004
If your hosting server is using some flavor
of UNIX, you might want to try the .htaccess file
and .htpasswd file route.
It's really not that hard to do.
They are created in Notepad.
To save a Notepad file without a file
extension, select Save as and then type
in ".htpasswd" and click save.
Here's a "How to"

http://www.euronet.nl/~arnow/htpassw...mentation.html

--
Steve Easton
MS MVP FrontPage
95isalive
This site is best viewed..................
...............................with a computer

" JCO" <(E-Mail Removed)> wrote in message
newsxPUb.20195$(E-Mail Removed)...
> I want to add a simple Form Field & Push Button so that when selected,

will
> validate
> a field to allow the user to go to the next page or not. Nothing fancy.
>
> I created a separate htm page with a form field:
>
> How do you verify the field (when the button is selected)?
> How do you, programmatically with JavaScript's, open the next page or
> display a blank page.
>
> Any help on this code (script) is appreciate.
>
>



 
Reply With Quote
 
JCO
Guest
Posts: n/a
 
      7th Feb 2004
Thanks Jim,
I have done this now. Is there a way to force an "Enter" on the text box to
automatically be the same as hitting the btnNext button? I've done this in
C++ code but not familiar with the JavaScript methods.

"Jim Buyens" <(E-Mail Removed)> wrote in message
news:b25d01c3ecd6$31b1acb0$(E-Mail Removed)...
> >-----Original Message-----
> >I want to add a simple Form Field & Push Button so that
> >when selected, will validate a field to allow the user to
> >go to the next page or not. Nothing fancy.
> >
> >I created a separate htm page with a form field:
> >
> >How do you verify the field (when the button is selected)?

>
> First, make sure the button is truly a pushbutton
> (type="button") and not a Submit button (type="submit").
>
> Then, add an onclick= atribute as shown below:
>
> <input type="button" onclick="valForm();" value="Next"
> name="btnNext">
>
> Finally, add a script such as the following anywhere in
> the Web page. (The <head> section is a common choice.)
>
> <script>
> function valForm(){
> }
> </script>
>
> >How do you, programmatically with JavaScript's, open the
> >next page ordisplay a blank page.

>
> Inside the fucntion you just created, code whatever tests
> you want want, then set window.location.href to the URL of
> the next page to display. Here's an example that assumes a
> text box named txtName shouldn't be empty.
>
> <script>
> function valForm(){
> if (document.forms[0].txtName.value == "") {
> return 0;
> }
> document.location.href="nextpage.htm";
> }
> </script>
>
> Jim Buyens
> Microsoft FrontPage MVP
> http://www.interlacken.com
> Author of:
> *----------------------------------------------------
> |\---------------------------------------------------
> || Microsoft Office FrontPage 2003 Inside Out
> ||---------------------------------------------------
> || Web Database Development Step by Step .NET Edition
> || Microsoft FrontPage Version 2002 Inside Out
> || Faster Smarter Beginning Programming
> || (All from Microsoft Press)
> |/---------------------------------------------------
> *----------------------------------------------------
>
>



 
Reply With Quote
 
Jim Buyens
Guest
Posts: n/a
 
      8th Feb 2004
Add this attribute to the text box:

onkeypress="if(event.keyCode==13) document.forms[0].btnNext.click();"

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------



" JCO" <(E-Mail Removed)> wrote in message news:<A97Vb.18826$(E-Mail Removed)>...
> Thanks Jim,
> I have done this now. Is there a way to force an "Enter" on the text box to
> automatically be the same as hitting the btnNext button? I've done this in
> C++ code but not familiar with the JavaScript methods.
>
> "Jim Buyens" <(E-Mail Removed)> wrote in message
> news:b25d01c3ecd6$31b1acb0$(E-Mail Removed)...
> > >-----Original Message-----
> > >I want to add a simple Form Field & Push Button so that
> > >when selected, will validate a field to allow the user to
> > >go to the next page or not. Nothing fancy.
> > >
> > >I created a separate htm page with a form field:
> > >
> > >How do you verify the field (when the button is selected)?

> >
> > First, make sure the button is truly a pushbutton
> > (type="button") and not a Submit button (type="submit").
> >
> > Then, add an onclick= atribute as shown below:
> >
> > <input type="button" onclick="valForm();" value="Next"
> > name="btnNext">
> >
> > Finally, add a script such as the following anywhere in
> > the Web page. (The <head> section is a common choice.)
> >
> > <script>
> > function valForm(){
> > }
> > </script>
> >
> > >How do you, programmatically with JavaScript's, open the
> > >next page ordisplay a blank page.

> >
> > Inside the fucntion you just created, code whatever tests
> > you want want, then set window.location.href to the URL of
> > the next page to display. Here's an example that assumes a
> > text box named txtName shouldn't be empty.
> >
> > <script>
> > function valForm(){
> > if (document.forms[0].txtName.value == "") {
> > return 0;
> > }

> document.location.href="nextpage.htm";
> > }
> > </script>
> >
> > Jim Buyens
> > Microsoft FrontPage MVP
> > http://www.interlacken.com
> > Author of:
> > *----------------------------------------------------
> > |\---------------------------------------------------
> > || Microsoft Office FrontPage 2003 Inside Out
> > ||---------------------------------------------------
> > || Web Database Development Step by Step .NET Edition
> > || Microsoft FrontPage Version 2002 Inside Out
> > || Faster Smarter Beginning Programming
> > || (All from Microsoft Press)
> > |/---------------------------------------------------
> > *----------------------------------------------------
> >
> >

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
adding a password to a button pat67 Microsoft Access Queries 0 9th Oct 2009 03:55 PM
Inspector doesn't change Save-Button to Send-Button when adding recipients via VB HarryWild Microsoft Outlook Program Addins 0 16th Jan 2008 10:20 AM
Adding a filter to a command button that has a security password =?Utf-8?B?S2V2aW4=?= Microsoft Access Form Coding 11 24th Nov 2006 11:20 AM
adding pop-up menu to a custom toolbar button for IE (like the Mail button). Hema Microsoft C# .NET 0 28th Mar 2006 03:13 PM
Help Needed Adding Password to Add Record Command Button TK Microsoft Access Forms 3 18th Mar 2004 02:04 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:26 AM.