2012-04-04 32 views
0

我有具有名称/ ID“注意”的输入字段中的形式:我使用javascript用文本区来代替它动态生成字段(客户端)调用qForm验证

<input name="notes" type="text" id="notes" tabindex="5" value="" size="60" maxlength="300" class="fauxTextArea"> 

导致在这:

<textarea rows="5" cols="60" title="" tabindex="5" style="" id="notes" name="notes" class=""></textarea> 

然后,我必须验证与qForms。没有多少选择用文本区域替换字段,并且根本没有选择使用qForms。

当我尝试提交表单时,除动态文本区域之外,所有字段都得到“验证”。

回答

0

......修复很痛苦简单。由于动态字段被添加到$(document).reday函数中,因此初始化和调用验证就像一个魅力一样工作。

$(document).ready(function(){ 
    $(".fauxTextArea").jqFauxTextArea();// the dynamic gets added here 
    objForm = new qForm("whitePapers"); 
    // the rest of qForm relates stuff ... 
}