Bandydan
Bandydan

Reputation: 631

My codeigniter form sends textarea using post, and does not send input type text

All.

My Codeigniter has one input type="text" and one textarea. Already on sending I can see (Chrome network sources), that $_POST array does not include input type="text" field, but includes textarea! I even tried to change input to textarea and it worked...

<form action="news_save" method="post" accept-charset="utf-8"> 

  <label class="control-label span3" for="subj">Subject</label>
  <input type="text" id="subj" name-"subj" class="row-fluid">

  <label class="control-label span3" for="body">Body</label>
  <textarea rows="3" name="body" class="row-fluid" id="body"></textarea>

  <button type="submit" class="btn btn-primary">Save</button>
</form>

Any suggestions, what can it be?

Upvotes: 0

Views: 2305

Answers (2)

Poria Sobhanlo
Poria Sobhanlo

Reputation: 29

$array= array(namedb' => $this->input->post('body'));

and after insert to db.

$this->ModelFile->MetodModel($array);

Upvotes: 0

chandresh_cool
chandresh_cool

Reputation: 11830

There is problem in input text near name attribute, instead of - it should be =

<input type="text" id="subj" name-"subj" class="row-fluid">

change it to this

<input type="text" id="subj" name="subj" class="row-fluid">

Upvotes: 2

Related Questions