Page 1 of 1

forms

Posted: Tue 13. Jan 2004, 13:21
by pbeckermann
I created the following contact form

IT|fname|1|First Name: |40,100||300
IT|lname|1|Last Name: |40,100||300
IT|company|1|Company: |40,100||300
IT|address|0|Address: |40,100||300
IT|city|0|City: |40,100||300
IT|state|0|State: |40,100||300
SC|country|0|Country: |10,100|US|300
IT|tel|0|Telephone: |40,100||300
IT|fax|0|Fax: |40,100||300
IT|website|0|Website: |40,100||300
IT|email|1|Email: |40,100||300
TA|msg|0|Message: |20,3||300
IH|send_copy|0||10,100|1|0

When i send the form i get this error

Error Description
[500] Fill in field ADDRESS.
[510] Fill in field CITY.
[520] Fill in field STATE.
[530] Fill in field TEL.
[540] Fill in field FAX.
[550] Fill in field WEBSITE.
[560] Fill in field MSG.

even though these fields should not have to be filled in

Thanks

Posted: Wed 14. Jan 2004, 08:59
by Oliver Georgi
as you can see

IT|fname|1|First Name... -> the 1 in third argument says: needed


IT|fname|0|First Name... -> set third argument = 0

That's it!


Oliver

Posted: Wed 14. Jan 2004, 09:01
by pbeckermann
Well i want that field to be filled in the problem is the other field that i dont want "NEEDED" are returning an error if i leave them blank

Posted: Wed 14. Jan 2004, 09:15
by Oliver Georgi
Hm.

Oliver

Posted: Sat 17. Jan 2004, 11:57
by waggis
Hi oliver,

Sorry boring you again with this. i have this bug too.

My form settings:
IT|fname|1|First Name: |40,100||300
IT|lname|1|Last Name: |40,100||300
IT|company|0|Company: |40,100||300
IT|address|0|Address: |40,100||300
IT|city|0|City: |40,100||300
IT|state|0|State: |40,100||300
SC|country|0|Country: |10,100|US|300
IT|tel|0|Telephone: |40,100||300
IT|fax|0|Fax: |40,100||300
IT|website|0|Website: |40,100||300
IT|email|1|Email: |40,100||300
TA|msg|0|Message: |20,3||300
IH|send_copy|0||10,100|1|0

If i leave the fields that are NOT required empty i get:
[500] Fill in field COMPANY.
[510] Fill in field ADDRESS.
[520] Fill in field CITY.
[530] Fill in field TEL.
[540] Fill in field FAX.
[550] Fill in field WEBSITE.

If every field is filled in, it works fine. Maybe there is an error with the required
not required check in formmailer.

Could you have a look at it ?

thanks
waggis

Posted: Sat 17. Jan 2004, 13:11
by Oliver Georgi
I really don't know what's wrong with your installation:

I have created a new form field with exact same content:

Code: Select all

IT|fname|1|First Name: |40,100||300 
IT|lname|1|Last Name: |40,100||300 
IT|company|0|Company: |40,100||300 
IT|address|0|Address: |40,100||300 
IT|city|0|City: |40,100||300 
IT|state|0|State: |40,100||300 
SC|country|0|Country: |10,100|US|300 
IT|tel|0|Telephone: |40,100||300 
IT|fax|0|Fax: |40,100||300 
IT|website|0|Website: |40,100||300 
IT|email|1|Email: |40,100||300 
TA|msg|0|Message: |20,3||300 
IH|send_copy|0||10,100|1|0 
And this is how it looks in frontend:
Image
and this is the result when I click send if nothing is filled in:
Image

Oliver

Posted: Wed 21. Jan 2004, 22:24
by Florian
Hello Oliver!

As I detected, if got the same problem, too.
This ist the Form "Code"

Code: Select all

IH|send_copy|0||10,100|1|0
IT|ansprechpartner|1|Ansprechpartner, Name: |40,100||300
IT|email|1|E-Mail: |40,255||300
IT|firma|0|Firma: |40,255||300
IT|straße|0|Straße, Hausnummer: |40,255||300
IT|plz|0|PLZ: |40,5||60
IT|stadt|0|Stadt: |40,255||300
IT|telefon|0|Telefon: |40,35||300
SC|country|1|Land: |10,100|DE|300
TA|info|1|Ihre Anfrage: |100,10||300

So the Form looks like this:
Image

The Result is this:
Image


Any proposals? I've checked the formail.php and everything looks fine.
So what can cause the error? Please help... :?
BTW: It makes no sense, if there is a hidden error/success redirect field is set, or not.

Cheers,
Florian

P.S.: Linux, PHP 4.3.4, safemode_restrictions ON, phpwcms 1.1-RC2 2004-01-11c

Posted: Wed 21. Jan 2004, 22:34
by Florian
As I see the source of the HTML File after the Form gets rendered looks well, too:

Code: Select all

<input type="hidden" name="required" value="ansprechpartner,email,country,info">

Thats the act_formmailer.php lines, where the required fields are checked:

Code: Select all

if(isset($_POST["required"])) {
	$req_key = explode(",", trim($_POST["required"]));
	if(count($req_key)) {
		$err_num=0;
		foreach($req_key as $value) {
			$required[$value] = 1;
			if(!isset($_POST[$value])) {
				$form_error[400+$err_num] = str_replace("###value###", strtoupper($value), $translate[$lang]["error400"]);
				$err_num+=10;
			}
		}
	}
	unset($_POST["required"]);
}

//SNIPP - SNAPP //

		if($required[$key] && isEmpty($value)) {
			if(isset($form_label[$key])) {
				$form_error[500+$err_num] = str_replace("###value###", $form_label[$key], $translate[$lang]["error400"]);
			} else {
				$form_error[500+$err_num] = str_replace("###value###", strtoupper($key), $translate[$lang]["error400"]);
			}			
			$err_num+=10;
		}

As I also regonized, when you've checked the reply in the backend als "HTML" you'll get also "TEXT".

Cheers,
Florian

Posted: Wed 21. Jan 2004, 23:19
by Oliver Georgi
That's right - not implemented (as I can remember)

Posted: Wed 21. Jan 2004, 23:27
by Oliver Georgi
I have an idea - is register_globals = On?

only this would make sense because then:

$_POST["required"] = $required = $required[$key]

and -> "if" will always be TRUE

I will rename the $required[$key] to handle this.

Oliver

Posted: Thu 22. Jan 2004, 13:44
by Florian
Hello again!

That's the solution. After turning off the register_globals (don't ask why they were on), the error disappers.
I'll kick my a** why I don't found out the solution by myself...

But, well thats things are going,
Florian

Posted: Sun 1. Feb 2004, 21:23
by Sarah
Please don't laugh to hard at this question, but where do I find register_globals so that I might turn them off?

I am having the same problem, and while I have it temporarily fixed by making all fields required, I'd like to solve it for good.

PTI - pardon the ignorance.

Posted: Sun 1. Feb 2004, 21:57
by adriano
I found the same problem for me too. But as I tried some ways, I found, that when I put the value "send copy" out of my form, all works fine.

Posted: Sun 1. Feb 2004, 22:19
by Oliver Georgi
@Sarah

please check here:
- http://de.php.net/manual/en/configurati ... er-globals
- http://martin.f2o.org/php/portable

You can setup this in PHP.INI or in Apache host setting or in .htaccess file.

Oliver