New user problem.

New user problem.

I have a little problem to get inputs value from <input> items.

I have a form with some fields, name, email ... and when i want to check users input values, i get an empty string.

here is my form code :

  1.             <FIELDSET>
                <LEGEND align=top>Contactez Nous</LEGEND>
                    <form id="formul">
                    <table cellpadding="0" cellspacing="5" width="100%">
                        <tr>
                            <td>Nom : *</td>
                            <td><input id="nom" name="nom" type="text" value="" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>Pr&eacute;nom : </td>
                            <td><input id="prenom" type="text" value="" /></td>
                            <td>&nbsp;</td>
                        </tr>   
                        <tr>
                            <td>Soci&eacute;t&eacute; : </td>
                            <td><input id="societe" type="text" value="" /></td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td>Email : *</td>
                            <td><input class="email" id="email" type="text" value="" /></td>
                            <td>&nbsp;</td>
                        </tr>  
                        <tr>
                            <td>T&eacute;l&eacute;phone : </td>
                            <td><input id="phone" type="text" value="" /></td>
                            <td class="comment">&nbsp;</td>
                        </tr>
                        <tr>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>                 
                        <tr>
                            <td>Message : *</td>
                            <td><textarea id="message" rows="8" cols="10"></textarea></td>
                            <td>&nbsp;</td>
                        </tr>  
                        <tr>
                            <td>&nbsp;</td>   
                            <td>&nbsp;</td>                 
                            <td class="comment"><input type="button" value="Envoyer" onclick="SendMessage()" /></td>                    
                        </tr>                                                                                                            
                    </table>
                    </form>
               </FIELDSET>



















































And here is my JS code :

  1. function SendMessage()
    {
        var nom = document.getElementById('nom').value;    
        alert(nom);
        nom = $("#nom").val();
        alert(nom);




  2. }
If i write something on the 'nom' input, and press the button that will use the SendMessage() function, i always have 2 empty alerts...

What i am doing wrong ?

PS : jquery version : jQuery JavaScript Library v1.4.2