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-23-2011 [eluser]Maglok[/eluser] Hey macigniter. Thanks for the reply. I did do a clear after building them, instead of after validating. Unfortunately that isnt working for me. I still get tied to form 1 if form 2 is filled out. The email field in form 1 is required, but obviously not if form 2 is filled out. Apologies in advance, but this is the code: Code: // Build new user form I build 2 forms, one at a time. This setup can be found on http://pona.dev.fss.uu.nl Any idea? Form Generation Library - El Forum - 02-23-2011 [eluser]macigniter[/eluser] [quote author="Maglok" date="1298477478"] Unfortunately that isnt working for me. I still get tied to form 1 if form 2 is filled out. [/quote] Well, if you use 2 forms on one page you need to give those forms unique names! You need to use Code: $this->form->open(current_url(), 'NAME1'); Form Generation Library - El Forum - 02-23-2011 [eluser]Maglok[/eluser] Can't believe I forgot that. I guess I got lazy since you can ommit the open tag in your library if you just want it set up in default mode. I have now added: ->open(current_url(), 'new_user') And another to the other form. I still get a red circled email block if I am logging in on the other form. No errors actually, which is odd as well. Form Generation Library - El Forum - 02-23-2011 [eluser]macigniter[/eluser] [quote author="Maglok" date="1298479788"] I still get a red circled email block if I am logging in on the other form. No errors actually, which is odd as well. [/quote] One more thing should do the trick... use different names for the submit() button like this: Code: // form 1 Form Generation Library - El Forum - 02-23-2011 [eluser]Maglok[/eluser] That did it! I knew those things in my head. I know submit buttons and forms need unique names. I just never thought to assign them in the library like this. Thanks! That was a big help. Form Generation Library - El Forum - 02-23-2011 [eluser]macigniter[/eluser] [quote author="Maglok" date="1298480618"]I knew those things in my head. I know submit buttons and forms need unique names. I just never thought to assign them in the library like this. [/quote] The library does a LOT, but not everything :-P Glad it worked out! Form Generation Library - El Forum - 02-23-2011 [eluser]c-s-n[/eluser] Forms do not need a name - but submits should be unique for correct processing, yes What I just found out after validating my page: If one passes NULL as value to the textarea-function, there is an empty attribute "value" created (which is not valid for this element). It does not happen with an empty string or a boolean value - just with null. This is in so far a "problem", as I use the data I get from the db-query. And there I have empty fields... At the moment I can live with this validation error, but maybe it's possible that also null can lead to just an empty, valid textarea? I don't want to prepare my whole data... Form Generation Library - El Forum - 02-23-2011 [eluser]macigniter[/eluser] [quote author="c-s-n" date="1298489378"] Forms do not need a name - but submits should be unique for correct processing, yes [/quote] Oh, okay. Good :-) [quote author="c-s-n" date="1298489378"] What I just found out after validating my page: If one passes NULL as value to the textarea-function, there is an empty attribute "value" created (which is not valid for this element). It does not happen with an empty string or a boolean value - just with null. [/quote] Thanks for letting me know! I will change this behaviour so that NULL will not create an empty 'value' attribute. Update will be available this weekend. Form Generation Library - El Forum - 02-25-2011 [eluser]JonoB[/eluser] Edit. Nothing to see here. Sorry for my ignorance Form Generation Library - El Forum - 02-26-2011 [eluser]macigniter[/eluser] [quote author="JonoB" date="1298433553"]Apologies if this is a silly question: is it possible to get checkbox labels aligned on the left of the checkbox?[/quote] This is possible with the newest version. Please download the latest version and check the welcome controller. It has an example of how to position the label before the checkbox. |