0

I would like to submit a form from a leaflet popup to modify datas in a mysql db.

lyrClients.eachLayer(function(e){ 

                    if(e.feature.properties.IdClient==IdClient){
                        e.bindPopup("<form method='post' action='ajax/filldbclient.php'>First name:<br><input type='text' name='firstname' value='Your first name' ><br>Last name:<br><input type='text' name='RaisonSociale' value='Your last name'></form><input class='click' type='submit' name='submit' value='Sent'>" );              
                        e.openPopup();
                    }



        });

This does not work because as explained here click event seems to be disable in popup. But I did not found the way to make it works.. (I mean for a submit) Thanks by advance for your help.

Community
  • 1
  • 1
rogerlette
  • 13
  • 3

1 Answers1

0

Your input button element needs to be within the form element:

Change:

</form><input class='click' type='submit' name='submit' value='Sent'>

To:

<input class='click' type='submit' name='submit' value='Sent'></form>
iH8
  • 27,722
  • 4
  • 67
  • 76
  • Thanks iH8 ;) sorry for those stupid questions, I'm starting with all those languages – rogerlette Oct 04 '15 at 08:27
  • No thanks, no problem, always welcome. Don't feel bothered, every developer on the planet has/had to learn to get where they are today. Cheers & good luck! – iH8 Oct 04 '15 at 09:08