[eluser]Unknown[/eluser]
Hi All,
I am having trouble to work with forms created using codeigniter. I have tried number of ways to render a form on the webpage. But am unsuccessful at different points.
1. I tried to render a form with code:
Code:
<?php
$this -> load -> helper('form');
$formattr = array('id="form1"');
form_open('registerUsr', $formattr);
?>
<fieldset>
<legend>
Registration Form
</legend>
<p class="first">
<label for="firstName">First Name: </label>
<input type="text" id="name" name="firstName" size="20" value="<?php echo set_value('first_name'); ?>" />
</p>
<p class="first">
<label for="scndName">Second Name: </label>
<input type="text" id="name" name="scndName" size="20" value="<?php echo set_value('scnd_name'); ?>" />
</p>
-
-
-
-
</fieldset>
<p class="submit">
<button type="submit" value="Submit" />
</p>
<?php echo form_close(); ?>
2. I have also tried to completely render it using options given in form helper class like
Code:
<?php echo form_open('registerUsr');
echo form_input('$data');
echo form_submit('submit', 'Submit');
echo form_close();?>
3. I have tried hybrid variety using mix of html tags and helper class functions.
But in all the ways, on final render of the form on web page <form class="form1"> and </form> tags are missing
And also instead of index.php/registerUsr, it is going into index.php/searchUniv page. (Checked routes.php. It is correctly pointed)
Any suggestions / ideas appreciated
TIA :-)
Ashok