This content has been marked as final.
Show 9 replies
-
1. Re: Make "Submit" form button active
Stephen Pickering122 Nov 3, 2007 10:00 AM (in response to Stephen Pickering122)FYI, the code I used is from "encrypted password" from Dynamic Drive. -
2. Re: Make "Submit" form button active
Newsgroup_User Nov 3, 2007 2:06 PM (in response to Stephen Pickering122).oO(is this taken?)
>I have several pages that require a password be typed, then clicking "Submit"
>to take them to the real page. The Submit button is a Form but I do not know
>how to make it "active" so that one can type the password and hit ENTER key
>(instead of having to click it with the mouse) to submit the form. I have the
>code below:
Two things:
1. The code is invalid. The 'form' element requires an 'action'
attribute, which points to the server's form processing script. There
should also be a 'method' attribute to define the form submission method
(POST would make sense in your case).
2. Password fields should use the type 'password'.
3. There's no submit button at all. Try a real one without any JS:
<input type="submit" value="submit">
This will work always.
HTH
Micha -
3. Re: Make "Submit" form button active
Newsgroup_User Nov 3, 2007 2:07 PM (in response to Stephen Pickering122).oO(Michael Fesser)
>Two things:
Three of course ...
Micha -
4. Re: Make "Submit" form button active
Newsgroup_User Nov 3, 2007 2:57 PM (in response to Stephen Pickering122)Michael Fesser wrote:
> 1. The code is invalid. The 'form' element requires an 'action'
> attribute, which points to the server's form processing script. There
> should also be a 'method' attribute to define the form submission method
> (POST would make sense in your case).
Believe it or not, but both the action and method attributes are
optional. If no action is defined, the same page attempts to process the
form. If no method is defined, the default is to use GET.
Having said that, it's better to define both.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
5. Re: Make "Submit" form button active
Newsgroup_User Nov 3, 2007 3:18 PM (in response to Stephen Pickering122).oO(David Powers)
>Michael Fesser wrote:
>> 1. The code is invalid. The 'form' element requires an 'action'
>> attribute, which points to the server's form processing script. There
>> should also be a 'method' attribute to define the form submission method
>> (POST would make sense in your case).
>
>Believe it or not, but both the action and method attributes are
>optional.
The method is optional, but the action is required.
Micha -
6. Re: Make "Submit" form button active
Stephen Pickering122 Nov 3, 2007 3:32 PM (in response to Newsgroup_User)quote:
Originally posted by: Newsgroup User
Two things:
1. The code is invalid. The 'form' element requires an 'action'
attribute, which points to the server's form processing script. There
should also be a 'method' attribute to define the form submission method
(POST would make sense in your case).
2. Password fields should use the type 'password'.
3. There's no submit button at all. Try a real one without any JS:
<input type="submit" value="submit">
Thank you. However because this is for security (as little as it is) my understanding is that I need the js. You're right though, there is no "submit" button at all. So you can see exactly what I working with, here is the example page: http://drywaterweddings.com/couples/testing/testing.html the password is "lastname"
How can I use "<input type="submit" value="submit">" Without messing up the rest of the code?
Thanks for your help. -
7. Re: Make "Submit" form button active
Newsgroup_User Nov 4, 2007 1:40 AM (in response to Newsgroup_User).oO(is this taken?)
> Thank you. However because this is for security (as little as it is) my
>understanding is that I need the js.
JS doesn't do any good for security. It can't protect anything. In fact
your current script is just "security by obscurity", which will always
fail sooner or later.
>You're right though, there is no "submit"
>button at all. So you can see exactly what I working with, here is the example
>page: http://drywaterweddings.com/couples/testing/testing.html the password is
>"lastname"
Ugly script. What if you want to add more users and passwords one day?
And do you really mean "Java" as mentioned on the page? Or shouldn't
that be "JavaScript" instead, which is an entirely different thing?
> How can I use "<input type="submit" value="submit">" Without messing up the
>rest of the code?
I strongly suggest to drop that useless script, use a simple proper form
and a server-side script to validate the password(s).
Micha -
8. Re: Make "Submit" form button active
Newsgroup_User Nov 4, 2007 3:08 AM (in response to Stephen Pickering122)Michael Fesser wrote:
> The method is optional, but the action is required.
Yes, you're right. Confusingly, although action is required, it can take
an empty string (action=""). When this happens, the page attempts to
process the form itself, a common scenario with both client-side and
server-side scripts.
--
David Powers, Adobe Community Expert
Author, "The Essential Guide to Dreamweaver CS3" (friends of ED)
Author, "PHP Solutions" (friends of ED)
http://foundationphp.com/ -
9. Re: Make "Submit" form button active
Newsgroup_User Nov 4, 2007 8:10 AM (in response to Stephen Pickering122).oO(David Powers)
>Michael Fesser wrote:
>> The method is optional, but the action is required.
>
>Yes, you're right. Confusingly, although action is required, it can take
>an empty string (action=""). When this happens, the page attempts to
>process the form itself, a common scenario with both client-side and
>server-side scripts.
Correct. Even an empty URL is completely valid (same-document
reference).
But I can remember a problem with empty URLs in the action attribute
some years ago. I'm not sure which browser it was, IIRC it was an old
Lynx. The problem was, that the browser didn't resolve the empty URL
correctly to the URL of the current document, but to the _directory_ of
that document, which was entirely wrong of course.
Since then I've never used empty action attributes again, I always
specify the (relative) URL to the script, even if it's the same page.
Micha


