Welcome Guest, Not a member yet? Register   Sign In
Form helper not working
#1

[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
#2

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

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

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

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

Outputs the string "form_submit()" literally?
#5

[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...
#6

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

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

InsiteFX
#7

[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!" />
#8

[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




Theme © iAndrew 2016 - Forum software by © MyBB