![]() |
question on how can I disable form_input area? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: question on how can I disable form_input area? (/showthread.php?tid=54555) |
question on how can I disable form_input area? - El Forum - 09-13-2012 [eluser]Nano HE[/eluser] Hello. How can I do this? I want only disable one input area in my form. And show some alert contents in the disabled form instead. Code: $data = array( and the webpage viwed like this, Like this: [Disabled Search for Traffic Limitation] question on how can I disable form_input area? - El Forum - 09-13-2012 [eluser]CroNiX[/eluser] Did you try adding 'disabled' => TRUE? question on how can I disable form_input area? - El Forum - 09-13-2012 [eluser]TWP Marketing[/eluser] [quote author="Nano HE" date="1347580582"]Hello. How can I do this? I want only disable one input area in my form. And show some alert contents in the disabled form instead. Code: $data = array( echo ' [Disabled Search for Traffic Limitation]'; } and the webpage viwed like this, Like this: [Disabled Search for Traffic Limitation] [/quote] You will need to pass the flag: $disable from your controller as a boolean true/false question on how can I disable form_input area? - El Forum - 09-13-2012 [eluser]PhilTem[/eluser] As CroNiX said you need to set the disabled attribute, however not in the way he said sine this is considered not RFC compliant, so use Code: $data = array( which will create a form input that can not be edited though (and by the way won't be submitted when the form is submitted ![]() question on how can I disable form_input area? - El Forum - 09-13-2012 [eluser]CroNiX[/eluser] @philTem, did you look at the html that using 'disabled' => TRUE produces? It's the same. Code: <input type="text" size="25" disabled="disabled" maxlength="100" id="searchform" value="" name="keyword"> question on how can I disable form_input area? - El Forum - 09-14-2012 [eluser]PhilTem[/eluser] Oh really, it does produce disabled="disabled"? I didn't know that. But I guess that's the point of forums: You never stop learning new stuff ![]() question on how can I disable form_input area? - El Forum - 09-15-2012 [eluser]Nano HE[/eluser] Code: echo form_open($formSearchOpenUrl, $attributes); Via URL: http://www.w3schools.com/tags/tag_input.asp I found the default recommand attribute value for Code: 'disable' Code: 'disabled' Thank you so much. My problem solved with your help. I posted my code here. |