form 생성 (2)
<?php
$submit_attributes = array('onsubmit' => "return check_if_valid();", 'id' => 'auth' );
echo form_open('auth', $submit_attributes ); /* action, 설정값, hidden */
echo "<table><tr><td>";
// The attributes of the <input tag>
echo form_label("User Name");
echo "</td><td>";
echo form_input(array('name' => 'user_name','value' => '' ));
echo "</td><td>";
echo "<label id='user_name_err' style='color:red; display:none'> name is too short </label>";
echo "</td></tr>";
echo '<tr><td>';
echo form_label("Password");
echo "</td><td>";
echo form_password("password","");
echo "</td><td>";
echo "<label id='password_err' style='color:red; display:none'> password is too short </label>";
echo "</td></tr>";
echo "</table>";
echo form_input(array( 'type' => 'submit' , 'value' => 'Login' ));
echo form_close();
?>