Welcome Guest, Not a member yet? Register   Sign In
How to pass ID through a form?
#1

[eluser]Volkof[/eluser]
Hi guys,

In my view, I have a review(basically a paragraph of text) and a comment box at the bottom. Since the review is fetched from database, I have the reviewID.
So now what Im trying to do is when a user enters comments into the box and click submit, the reviewID and comments will be passed to the controller to store into the database.
Problem is I'm not sure how to pass the reviewID through <form>

Code:
echo form_open('comment/addComment/');
  //echo validation_errors();
  
  $comment = array(
              'name'        => 'comment',
   'rows'  => '4',
              'cols'        => '30',
            );
  
  echo "<p>Your comment for this review:<br/>";
  echo form_textarea($comment);
  echo "</p>";

  echo "<p>";
  echo form_submit('submit', 'Post Comment');
  echo "</p>";

  echo form_close();

I tried
Code:
echo form_open('comment/addComment/'$row->reviewID);
but it does not work.

Any idea? Thanks in advance


Messages In This Thread
How to pass ID through a form? - by El Forum - 01-04-2013, 02:54 AM
How to pass ID through a form? - by El Forum - 01-04-2013, 03:59 AM
How to pass ID through a form? - by El Forum - 01-04-2013, 05:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB