5

I have a form with over 50 input fields. The input fields are divided into 5 jquery jabs within the form container. Here's a sample of what it looks like:

<form action="admin/save" method="post" enctype="multipart/form-data">
     <input type="hidden" name="type" value="department" />
     <input type="hidden" name="id" value="21" />
     <div id="tabs">
       <ul>
         <li><a href="#tab-1">Tab 1</a><li>
         <li><a href="#tab-2">Tab 2</a><li>
         <li><a href="#tab-3">Tab 3</a><li>
       </ul>
       <div id="tab-1">
         <label>Name</label>
         <input type="text" name="user-name" />
       </div>
       <div id="tab-2">
         <label>Address</label>
         <input type="text" name="user-address" />
       </div>
       <div id="tab-3">
         <label>Phone</label>
         <input type="text" name="user-phone" />
       </div>
     </div>
     <input type="submit" value="Send" />
</form>

I'm using PHP's Kohana framework, so admin maps to a controller, and save maps to the method action_save.

When I output the $_POST variables in action_save, only 'type' and 'id' show up, all the other fields don't seem to submit their data.

What could I be doing wrong?

HyderA
  • 20,651
  • 42
  • 112
  • 180
  • at any point do you disable the other fields? if so they won't submit successfully. – scunliffe May 31 '10 at 02:19
  • I don't understand, I don't disable any fields. – HyderA May 31 '10 at 02:21
  • any chance you have a url? I get the feeling that the tabs might somehow get moved outside the form tag. – scunliffe May 31 '10 at 02:25
  • it' an internal app, so no url for you. and i searched for 'form', I get only two results the opening tag and the ending tag, and the tabs are within them – HyderA May 31 '10 at 02:30
  • If you move any "text input" tag inmediately after the hidden form elements, will new data appear in `$_POST` after sending the form? Maybe your HTML is not well formed. (for example, the `li` tags in the example aren't closed properly) – dusan May 31 '10 at 21:45

2 Answers2

2

Have you tried this with different browsers and sniffed the network traffic to see exactly what's being sent?

0

Grab Firebug and make sure it's actually sending the POST data.

Josh K
  • 28,364
  • 20
  • 86
  • 132