Welcome Guest, Not a member yet? Register   Sign In
CSS + form helper + jquery question
#1

[eluser]Juan Velandia[/eluser]
Hello every one. I've dealing with this issue for a while, could anyone please tell me the advantages/disadvantages of use this code:
Code:
<input value="" class="validate[required] text-input" type="text" name="req1" id="req1" />
instead of this:
Code:
<?php echo form_input(array('name' => 'req1', 'id' => 'req1', 'size' => '30', 'value' => '', 'class' => 'validate[required] text-input')) ?>

having in mind that the first line it's almost half of the second one.
Thanks in advance!
#2

[eluser]toopay[/eluser]
There are no such things, what you called "advantages/disadvantages", in above comparation. They're rendering same things in a browser. Its true that the first one use less memory and less words than the second, but it's will be too small to count as "advantages".

It's all about your coding standard. I'm personally prefer to create a helper(and hook), in order to write above line into pseudo variable like:
Code:
{pseudo:form_input name:req1 id:req1 class:validate[required] text-input}




Theme © iAndrew 2016 - Forum software by © MyBB