Search code examples
phpprestashopsmarty

How to get value from input when the input has a space in the name?


Maybe this is silly. But I have problem with this. I have dropdown list with some values for example:

<select name="Name Kombinezony" class=" fixed-width" id="Name Kombinezony">
<option value="Home">Home</option>
</select>

I have problem to get the value from this beacuase the input file has a space in name. The worst is that I need to have a space in name. How to resolve this problem ? I get the value by using:

Tools::getValue($category)

Kind regards ?


Solution

  • PrestaShop will concatenate it with an underscore, so, you can get the value like this: Tools::getValue('Name_Kombinezony')

    PD. Tested in PS 1.7