Form Builder :: $submitValues does not support foreign characters

suwsuw
edited June 2012 in Bug Reports
Hello,
I just realized that Fuel form_builder's option "submit_values" does not support special characters,

fuel/application/libraries/Form_builder.php
line: 407, 654
... $this->form->$submit_btn($this->submit_value, $this->submit_value,...);


I suppose form's id and name (second param) can be changed with some fixed or global value instead the label - to avoid the
"Disallowed Key Characters." error

Comments

  • edited 4:46AM
    You can also pass an entire tag as the value as well like so:
    <input type="submit" value="Submit Form" name="submit" id="submit" />
  • suwsuw
    edited June 2012
    Of course you can - but isn't this simple?

    $this->form_builder->submit_value = lang("btn_config");

    i've made a patch - if you wish to take a look please :)
    http://inarad.ro/opensource/Form_builder.patch
  • edited 4:46AM
    I agree. I'll implement that for the next release we are working on.
  • suwsuw
    edited 4:46AM
    thank you
  • edited 4:46AM
    How about exposing the submit button's class too? HI had a case to change it from the default .submit for use with the foundation framework. Maybe a little lazy of me..
  • suwsuw
    edited June 2012
    How about this.
    Don't change much from your Form_builder class, but allow one to add submit button with options like any other input field.

    I just added 3 lines to Form_builder.php - to allow one to define also "submit" option,
    here's a quick example:

    $this->load_library('form_builder');

    $fields['send_btn']=array(
    "type" => "submit",
    "value" =>"My submit button",
    "class" =>"submit"
    );
    $fields['some_text']=array(
    "type"=>"input",
    "label"=>"Some Text"
    )

    $this->form_builder->render($fields);
    You'll notice that send button is built before input text,
    now you can add submit button in a group or whatever you want - if you have
    a big form - you can have multiple submit buttons...

    the default submit button is not rendered if we already have a submit button

    here's the patch - add it to original Form_builder.php (this patch also include the 'foreign character' fix) http://inarad.ro/opensource/Form_builder_1.patch

    or you can download the whole php file from here http://inarad.ro/opensource/Form_builder.php_
Sign In or Register to comment.