2012-04-04 78 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 ... 
}