I mistakenly required a comment text area in a form. Is there a way I can un-require it by making changes in the form or process php? I am a php newbie and can't quite figure out how it finds the match.
thanks
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In the process.php file you will find, after the last pt_register...., an IF statement like the one below.
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
If the comment variable is the one you want to "un-require" delete the variable and the "OR" characters so it looks like this,
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" ){
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
If you open up the process.php file for your form, you will see a line that looks something like this:
if($fieldname1=="" || $fieldname2=="" || $fieldname3=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
Simply remove the double lines and the fieldname that you don't want to be required, and it should work fine. (remove -> || $fieldname2=="" ). If I want to NOT require FIELDNAME2 anynmore, I would change it like this:
if($fieldname1=="" || $fieldname3=="" ){
Also, I think you have to open your form1.html file, and remove the '*' that shows up on the form, which would tell people it is required.
As long as you change the process.php file, then it won't check for the field being required, even if you leave the '*' beside it on the form.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I mistakenly required a comment text area in a form. Is there a way I can un-require it by making changes in the form or process php? I am a php newbie and can't quite figure out how it finds the match.
thanks
In the process.php file you will find, after the last pt_register...., an IF statement like the one below.
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" || $Comment=="" ){
If the comment variable is the one you want to "un-require" delete the variable and the "OR" characters so it looks like this,
pt_register('POST','Comment');
if($Name=="" || $EmailAddress=="" ){
If you open up the process.php file for your form, you will see a line that looks something like this:
if($fieldname1=="" || $fieldname2=="" || $fieldname3=="" ){
$errors=1;
$error.="<li>You did not enter one or more of the required fields. Please go back and try again.";
}
Simply remove the double lines and the fieldname that you don't want to be required, and it should work fine. (remove -> || $fieldname2=="" ). If I want to NOT require FIELDNAME2 anynmore, I would change it like this:
if($fieldname1=="" || $fieldname3=="" ){
Also, I think you have to open your form1.html file, and remove the '*' that shows up on the form, which would tell people it is required.
As long as you change the process.php file, then it won't check for the field being required, even if you leave the '*' beside it on the form.