我已经像这样加载表格:
$('#content').load('contacts/contact.php #content' );
我的表格html是:
<div id="content">
<div class="post">
<h1 class="title">Nous contacter</h1>
<div class="entry">
<div id='form_wrap'>
<form method="post" name="contactForm" id="contactForm">
<p>hi,</p>
<label for="sujet">Sujet: </label>
<input type="text" name="sujet" value="" id="sujet" class="validate[required,custom[chaine]] text-input" data-prompt-position="topLeft:10"/>
<label for="message">Message : </label>
<textarea name="message" value="Votre Message" id="message" class="validate[required] text-input" data-prompt-position="topLeft:20"></textarea>
<p></p>
<label for="name">Nom: </label>
<input type="text" name="name" value="" id="name" class="validate[required,custom[chaine]] text-input" data-prompt-position="topLeft:10"/>
<label for="email">Email: </label>
<input type="text" name="email" value="" id="email" class="validate[required,custom[email]] text-input" data-prompt-position="topLeft:10"/>
<input type="submit" name ="env" id ="env" value="Envoyer" />
</form>
</div>
</div>
</div>
我想在提交后获取表单中元素的值,我尝试这样做:
$("#sujet").val()
但它不起作用!
如何获得它们(提交后)?
谢谢