PHP Classes

AddInput "TYPE"=>"select"

Recommend this page to a friend!

      PHP Forms Class with HTML Generator and JavaScript Validation  >  PHP Forms Class with HTML Generator and JavaScript Validation package blog  >  How to Show Google Ma...  >  All threads  >  AddInput "TYPE"=>"select"  >  (Un) Subscribe thread alerts  
Subject:AddInput "TYPE"=>"select"
Summary:AddInput "TYPE"=>"select"
Messages:6
Author:francesco
Date:2014-03-26 17:59:07
Update:2014-03-28 04:24:02
 

  1. AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of francesco francesco - 2014-03-26 17:59:08
Hi, I have try to input an array with special characters like èaùà etc, latin chars, and I have as result an empty value.
Every help will be appreciate

Best regards
Francesco

  2. Re: AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-03-26 18:17:49 - In reply to message 1 from francesco
Can you please show the complete command you are using to call the AddInput function?

  3. Re: AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of francesco francesco - 2014-03-27 08:18:32 - In reply to message 2 from Manuel Lemos
this is the code,
$form->AddInput(array(
"TYPE"=>"select",
"NAME"=>"credit_card_type",
"ID"=>"credit_card_type",
"VALUE"=>"pick",
"SIZE"=>1,
"OPTIONS"=>array(
"pick"=>"Pick a credit card type",
"unknown"=>"Unknown",
"mastercard"=>"Master Card",
"visa"=>"Visa",
"amex"=>"American Express",
"dinersclub"=>"Diners Club",
"carteblanche"=>"Carte Blanche",
"discover"=>"Discover",
"enroute"=>"enRoute",
"jcb"=>"JCB",
"0"=>"Là routè ùàòè"
),
"ValidateAsDifferentFromText"=>"pick",
"ValidateAsDifferentFromTextErrorMessage"=>
"Pick the credit card type or set to Unknown if you do not know the type.",
"ValidationErrorMessage"=>"It was not specified a valid credit card type.",
"LABEL"=>"Credit card t<u>y</u>pe",
"ACCESSKEY"=>"y"
));
As you can see, in OPTIONS I've put latin char, you can see the result in at this page: http://istitutomonteceneri.francescoallevi.org/libs/formsgeneration-2013-01-09/test_form.php, as you can the last voice in the menu select is empty, the php's version is 5.4.4, before with 5.3 I hadn't this problem, am I missing something?

Thank you

  4. Re: AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-03-27 11:04:39 - In reply to message 3 from francesco
Yes, PHP 5.4 changed the default encoding of HTMLSpecialChars and HTMLEntities, so it was failing.

I just uploaded a fixed version that assumes the encoding to be whatever you put in the class variable $encoding.

Thanks for reporting. Just let me know if you find any more issues.

  5. Re: AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of francesco francesco - 2014-03-27 14:12:04 - In reply to message 4 from Manuel Lemos
Thank you, but, I don't understand what I have to do to see the value.
I've fixed the problem with utf8_encode.


  6. Re: AddInput "TYPE"=>"select"   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2014-03-28 04:24:02 - In reply to message 5 from francesco
You just need to download and install the latest version.

It seems you are also using text in your source code encoded as iso-8859-1. In that case you need to make sure your page HTML is outputted also in iso-8859-1 character set.

In that case make sure your page has a statement like this in the <head> section:

<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">