nyromodal : When submitting a form, the name attribute of submit button and its value are not transmitted to server

StackOverflow https://stackoverflow.com/questions/11454054

  •  20-06-2021
  •  | 
  •  

Question

I'm using Nyromodal and I need to have 2 submit buttons ("save", "save and add") in my form and depending on which button I click, my server should redirect me on the right page using the name attribute of the <input type="submit" />

My problem is when I submit my form, the name attribute of submit's button and its value are not present in the $_POST variable.

All works perfectly if I don't display my form with nyroModal.

with nyroModal :

array (size=1)
  'form' => 
    array (size=2)
      'title' => string 'azerty' (length=5)
      'date' => string '12/07/2012' (length=10)

without nyroModal :

array (size=2)
  'form' => 
    array (size=2)
      'title' => string 'azerty' (length=30)
      'date' => string '12/07/2012' (length=10)
  'submit_button_name' => string 'OK' (length=7)

anyone have an idea how to do this with nyroModal

Thanks

Was it helpful?

Solution

The solution is to place an <input type="hidden" name="" /> in the form and assign a value to the name attribute when click on submit button.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top