1 Replies - 1207 Views - Last Post: 14 September 2012 - 11:44 AM

#1 jchinnasamy  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-September 12

<html:select> value not submitted for the second div style as

Posted 14 September 2012 - 10:30 AM

Hi,

On form submit, the value from the select element not getting submitted.
html:select element is surrounded by a div tag. If there is a single div tag, it works fine. But two div tags with the same html:select property name does not work.

Please note that on form submit only one div tag with style as inline and the other div style is none.
Is This A Good Question/Topic? 0
  • +

Replies To: <html:select> value not submitted for the second div style as

#2 Dormilich  Icon User is offline

  • 痛覚残留
  • member icon

Reputation: 3554
  • View blog
  • Posts: 10,335
  • Joined: 08-June 10

Re: <html:select> value not submitted for the second div style as

Posted 14 September 2012 - 11:44 AM

that’s because the latter <select> overwrites the former. you need to append [] to the name to make PHP read them as an array.
<select name="test[]"> … </select>
<select name="test[]"> … </select>

// or $_GET, if you use that
var_dump($_POST["test"]);

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1