re-populating data in the form for the SELECT tag |
[eluser]Unknown[/eluser]
Hi gys in the CI documentation they had given a clear document for re-populating the form data after the submit button is pressed to all input types (form) in Form Validation section except the SELECT, CHECKBOX & RADIO options. if any one knows how to repopulate the data for the SELECT option / RADIO/CHECKBOX just reply me. Thanx in advance for your golden reply..... Reagrds Kumar
[eluser]Evil Wizard[/eluser]
use the the "form_helper" Code: <?=form_radio(array('name'=>'radio1','id'=>'radio1_y', 'value'=>'y', 'checked'=>set_radio('radio1', 'y', TRUE)));?> there are examples here: http://ellislab.com/codeigniter/user-gui...elper.html
[eluser]Unknown[/eluser]
Hi thanx 4 the reply, i cant get wat u r trying to say, my problem is .... consider the situation 1. open form 2. insert a text box named "txtname" 3. insert a combo box named "country" - India - Australia - UK - Srilanka 4. insert a radio option for "gender" - Male - Female 5. insert a check box for "items" - Mobile - Laptop 6. insert a submit button 7. close form After creating the above said form, when i press submit button it has to validate the POST data if some datas are invalid then it should show error, [ I M GETTING ERROR ] after displaying the error, the old data which was entered in the text box is displaying using the set_value() function but i m not getting the re populated value for combo box, radio option and the check box. just send me a code where the things are working properly.... Thanx 4 the reply... --------------------------------- view File myform.php Code: <html> ------------------------------------ Controller File form.php Code: <?php
[eluser]LuckyFella73[/eluser]
I got to your post while searching for something and maybe it's too late to answer now but just in case: "set_select" and "set_checkbox" in you view-file does not work because you didn't set the rules for that element in your controller.
[eluser]George Tavas[/eluser]
I am suggesting the use of javascript to repolulate a form instead the use of the validation library. I have created jquery plugin for it. If anyone intrested just contact me.
[eluser]quest13[/eluser]
Can you send me the jquery validation library for repopulating the form ? Thank you my email id : [email protected]
[eluser]gmahesha[/eluser]
Hello friend, can i get the jquery validation library for repopulating the form ? my email id is [email protected] Thanks in advance. |
Welcome Guest, Not a member yet? Register Sign In |