01-26-2012, 07:20 AM
I am currently trying to learn the <form> object.
Now I have done some things within <form> like setting up text fields with submit buttons, etc..
But now on this part of the course it is showing properties I think, within the decleration of the <form> such as shown below
<FORM METHOD="POST" ACTION="/cgi-bin/correct.pl" onSubmit="return false;">
Could someone explain to me what that ACTION="/cgi-bin/corrct.pl" is for along with the onSubmit="return false;" ??
I'd like an explanation of the properties of <form> if you could please.
01-26-2012, 07:37 AM
You ought to Google for this sort of question.
The required action attribute of a form specifies where to send the form-data when a form is submitted. return false suppresses this action. The form will never be submitted. Normally a validation script is used which if the validation fails returns false, to prevent the form from being submitted.
The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute). The form-data can be sent as URL variables (with method="get") or as HTTP post (with method="post").
All advice is supplied packaged by intellectual weight, and not by volume. Contents may settle slightly in transit.
01-28-2012, 10:22 PM
If return false suppreses this, then why do I even need to put the ACTION part?
Why is it even there in this code if it's not actually submiting it?
01-28-2012, 11:09 PM
I suspect your book is just showing you format.
01-29-2012, 01:20 AM
So I'd like to clarify some information with you on my knowledge of this;
ACTION="/cgi-bin/correct.pl" onSubmit="return false;">
action being, where the submitted information is sent?
onSubmit meaning when the information is submitted, what to do?
01-29-2012, 03:22 AM
But, again, onsubmit is ignored if JS is disabled.
(As are all "onxxx" event handlers, of course.)