javascript - JQuery - Item selected -


I want to get selected items in my select tag

The HTML code is:

  & lt; = "Mail" for label & gt; Envoyer Mail: & lt; / Label & gt; & Lt; Select name = "mail" id = "selectmail" & gt; & Lt; Option value = "1" & gt; Case NA ° 1 & lt; / Options & gt; & Lt; Option value = "2" & gt; Case NA ° 2 & lt; / Options & gt; & Lt; Option value = "3" & gt; Case NA ° 3 & lt; / Options & gt; & Lt; / Select & gt; & Lt; Input type = "button" id = "sendmail" name = "mail" value = "envoyer" & gt; & Lt; A href = "" & gt; & Lt; / A & gt;   

And here is my JQuery function:

  $ ('# sendmail'). Click ($ .post ('adressepagetraitement.php', {v: $ ('# selectmail'). Val ()}, function (data) {warning ('message invitation';}));  < type error: Handle oz. handler The app is not a function. Apely (MacD.mail, AGR);    

/ div>

I think that you are failing in the way you click the handler. You should do this: < / P>

  $ (elementid). Click (function () {// keep your post code here });   

Keep $ .post within the function ($) braces and you'll be fine.

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -