D
DrKen
I'm working on a task that involves adding code to a web page in
order to store the user id in a cookie when the "Submit" button is
clicked. This is a new thing for me and my JavaScript skills are
minimal. After looking at several tutorials and the book I have, I
still have a basic question. If the current page has this,
<form name="FORM" action="" method="POST">
and I want the page to run a script when the user clicks "Log in" (the
submit button), do I code
<form name="FORM" action="" method="POST" onSubmit='return
createCookie()'>
Or, do I code
<form name="FORM" onSubmit='return createCookie()'>
?
The examples I'm seeing all show a minimal form statement without a
method at all. I thought that if you did't specify a method you got
"get" as the default. Are method=post and onSubmit='return
someJSfunction()' mutually exclusive? Thanks.
Ken
order to store the user id in a cookie when the "Submit" button is
clicked. This is a new thing for me and my JavaScript skills are
minimal. After looking at several tutorials and the book I have, I
still have a basic question. If the current page has this,
<form name="FORM" action="" method="POST">
and I want the page to run a script when the user clicks "Log in" (the
submit button), do I code
<form name="FORM" action="" method="POST" onSubmit='return
createCookie()'>
Or, do I code
<form name="FORM" onSubmit='return createCookie()'>
?
The examples I'm seeing all show a minimal form statement without a
method at all. I thought that if you did't specify a method you got
"get" as the default. Are method=post and onSubmit='return
someJSfunction()' mutually exclusive? Thanks.
Ken