CodeIgniter Forums
Form helper not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forum-21.html)
+--- Thread: Form helper not working (/thread-32844.html)



Form helper not working - El Forum - 08-06-2010

[eluser]Deathmanlp[/eluser]
I'm trying to use form helper but it's not working

My controller
Code:
<?php
Class Forms extends Controller
{
  function Forms ()
  {
    parent::Controller();
  $this->load->helper('form');
  $this->load->library('validation');
  }
  function index ()
  {
    parent::Controller();
    $this->load->view('forms_view');
  }
}
?>

My view

Code:
<html>
<head></head>
<body>
<input type="text"/>
<?php  form_submit(); ?>
</body>
</html>

The text field is displayed but the submit button not. I tried to use the helper for all types of forms but none of them works


Form helper not working - El Forum - 08-06-2010

[eluser]danmontgomery[/eluser]
Code:
<?php echo form_submit(); ?>



Form helper not working - El Forum - 08-06-2010

[eluser]Deathmanlp[/eluser]
Not working outputs form_submit()


Form helper not working - El Forum - 08-06-2010

[eluser]danmontgomery[/eluser]
You're saying the code:

Code:
<?php echo form_submit(); ?>

Outputs the string "form_submit()" literally?


Form helper not working - El Forum - 08-06-2010

[eluser]Unknown[/eluser]
[quote author="noctrum" date="1281143476"]You're saying the code:

Code:
<?php echo form_submit(); ?>

Outputs the string "form_submit()" literally?[/quote]

Thats a good suggestion...


Form helper not working - El Forum - 08-06-2010

[eluser]InsiteFX[/eluser]
Try changing it to this!

Code:
$this->load->library('form_validation');

InsiteFX


Form helper not working - El Forum - 08-07-2010

[eluser]verynewtothis[/eluser]
Correctly identified above that you were missing 'echo' in your view and you could also give your button a label:
Code:
// From the manual
echo form_submit('mysubmit', 'Submit Post!');

// Would produce:

<input type="submit" name="mysubmit" value="Submit Post!" />



Form helper not working - El Forum - 08-07-2010

[eluser]Deathmanlp[/eluser]
[quote author="kurad" date="1281173863"][quote author="noctrum" date="1281143476"]You're saying the code:

Code:
<?php echo form_submit(); ?>

Outputs the string "form_submit()" literally?[/quote]

Thats a good suggestion...[/quote]

When it does when it's quoted without quotes it works thanks verynewtothis