Note that there are some explanatory texts on larger screens.

plurals
  1. POset_value in codeigniter not responding
    primarykey
    data
    text
    <p>I am new to the codeigniter and i am trying its tutorials from the user guide. But i just got stuck in one place. In the code of the form validations. I am trying its example for the set_value property but my user text box is not returning anything.</p> <p>In my view i added the following code:</p> <pre><code>&lt;?php echo validation_errors();?&gt; &lt;?php echo form_open('form');?&gt; &lt;table border="0"&gt; &lt;tr&gt; &lt;td&gt;&lt;h5&gt;Username&lt;/h5&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="text" name="username" value="" size="50" value="&lt;?php echo set_value('username'); ?&gt;" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;h5&gt;Password&lt;/h5&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="password" name="password" value="" size="50" accept=" &lt;?php echo set_value('password'); ?&gt;" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;h5&gt;password Confirm&lt;/h5&gt;&lt;/td&gt; &lt;td&gt;&lt;input type="password" name="passconf" value="" size="50" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&lt;h5&gt;Email Addres&lt;/h5&gt;&lt;/td&gt; &lt;td&gt; &lt;input type="text" name="email" value="" size="50" accept="&lt;?php echo set_value('email'); ?&gt;" /&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt;&lt;div&gt;&lt;input type="submit" value="Submit" /&gt;&lt;/div&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;/form&gt; </code></pre> <p>and in my controller i added the following code:</p> <pre><code>function index() { $this-&gt;load-&gt;helper(array('form', 'url')); $this-&gt;load-&gt;library('form_validation'); $this-&gt;form_validation-&gt;set_rules('username','username','required|min_length[5]|max-length[10]|xss_clean'); $this-&gt;form_validation-&gt;set_rules('password','password','required'); $this-&gt;form_validation-&gt;set_rules('passconf','password confirmation','required'); $this-&gt;form_validation-&gt;set_rules('email','email','required'); if ($this-&gt;form_validation-&gt;run() == FALSE) { $this-&gt;load-&gt;view('myform'); } else { $this-&gt;load-&gt;view('formsucces'); } } </code></pre> <p>Thank You in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload