CodeIgniter Forums
Form Generation Library - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22)
+--- Thread: Form Generation Library (/showthread.php?tid=16439)



Form Generation Library - El Forum - 02-26-2011

[eluser]macigniter[/eluser]
Quote:New version 1.0.3 available!
Please read the changelog before downloading and upgrading.

The latest version includes several fixes and updates including the most important new feature to include attributes for both the element as well as its attribute. Please see the changelog for details.

It would be great if you show your support by sending me a postcard from where you live. Would be cool to see where the library is being used all over the world. Look for more details on the downloads page.


Form Generation Library - El Forum - 02-28-2011

[eluser]Davide Bellini[/eluser]
Great library macigniter!!!!!
But with the new version (1.0.2) I found a problem to use ->set_value() with hidden fields, It doesn't work.

With previuos version working properly...


Update :
I solved the problem by adding this code :

Code:
case 'hidden':
    $this->$el->value = $value;
    break;

on line 2739 in your library


Form Generation Library - El Forum - 02-28-2011

[eluser]macigniter[/eluser]
[quote author="Davide Bellini" date="1298907240"]Great library macigniter!!!!!
But with the new version (1.0.2) I found a problem to use ->set_value() with hidden fields, It doesn't work.
[/quote]

Thanks, Davide! I have no idea why this one got lost in the update. I have merged several versions and this code snippet must have been forgotten. I will update the library to 1.0.3 immediately.

Cheers!


Form Generation Library - El Forum - 03-01-2011

[eluser]Davide Bellini[/eluser]
Hi macigniter!
There's another bug in 1.0.3 ... the same for the previous (doesn't work with ->set_value()), but now is on textarea :

Solution (Line 2739) :
Code:
case 'textarea':
   $this->$el->value = $value;
   break;

Cheers!!


Form Generation Library - El Forum - 03-01-2011

[eluser]macigniter[/eluser]
[quote author="Davide Bellini" date="1299024305"]
There's another bug in 1.0.3 ... the same for the previous (doesn't work with ->set_value()), but now is on textarea :

Solution (Line 2739) :
Code:
case 'textarea':
   $this->$el->value = $value;
   break;
[/quote]

Awesome, thanks for being so thorough! 1.0.4 will be up soon :-P

You can actually just do this (less code):
Code:
case 'hidden':
case 'textarea':
$this->$el->value = $value;
break;



Form Generation Library - El Forum - 03-02-2011

[eluser]macigniter[/eluser]
Quote:Updated version 1.0.4 available!
Please read the changelog before downloading and upgrading.

Believe it or not, the user guide is finally complete! Big Grin

So if you have any questions or want to dig some deeper, the user guide is the place to go...


Form Generation Library - El Forum - 03-02-2011

[eluser]Davide Bellini[/eluser]
Good work Frank!!!! Thank you!


Form Generation Library - El Forum - 03-04-2011

[eluser]Davide Bellini[/eluser]
I get an error with ->onsuccess('redirect', 'users') :

Quote:A PHP Error was encountered

Severity: Warning

Message: call_user_func_array() expects parameter 2 to be array, string given

Filename: SC_Form/Form.php

Line Number: 2058


I solved changing line 2058:
Code:
call_user_func_array($func['function'], $func['values']);

with :
Code:
call_user_func_array($func['function'], array($func['values']));


And I have a question :
My model function is used by a controller method and by an API library ... I would that "&$form" was an optional parameter, how can I do this?

For example :
Code:
public function add_user(&$form <--[OPTIONAL], $input = array())



Form Generation Library - El Forum - 03-05-2011

[eluser]Cristian Gilè[/eluser]
@macigniter: I'd have liked to see in the last version the fix/enhancement for this:

http://ellislab.com/forums/viewthread/107861/P550/#833298


Cristian Gilè


Form Generation Library - El Forum - 03-06-2011

[eluser]c-s-n[/eluser]
V1.0.4 looks good! But what are that improvements in _check_post() method? For me the new method fails in following context:

On one of my pages, which includes 4 forms generated by your library, the version 1.0.4 treats all forms as if they are always submitted.
And because the validation is therefore done even on first page load, it fails. Further it prevents textareas and inputs in the erroneously validated form(s) to be filled.

I could reproduce this behaviour only on this single page. Other pages with "only" 3 forms for example still work like in V1.0.1. The submit buttons all have different names and I also tried different form names.

So I reverted that method to the old algorithm...