DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> JavaScript入門知識 >> jQuery入門知識 >> JQuery特效代碼 >> jQuery Form 頁面表單提交的小例子
jQuery Form 頁面表單提交的小例子
編輯:JQuery特效代碼     

. 代碼如下:
<script type="text/javascript" src="${ctx}/js/jquery.form.js"></script> 
<script type="text/javascript"> 
    //創建測試實例 
    function createInstance() { 
        var options = { 
            success : function(json) { 
                if (json.succ) { 
                    alert(json.info); 
                    window.parent.ymPrompt.doHandler("close", true); 
                } 
            } 
        }; 
        $("#f1").ajaxSubmit(options); 
    } 

    //關閉按鈕 
    function closeWindow() { 
        window.parent.ymPrompt.doHandler("close", true); 
    } 
</script> 

Form表單:

. 代碼如下:
<form id="f1" name="f1" action="${ctx}/process/createInstance.do" 
            method="post"> 
            <table style="width:100%; height:100%"> 
                <tr> 
                    <td nowrap="nowrap" style="text-align:right;">測試名稱:</td> 
                    <td><input type="text" name="name" value="${instance.name}" 
                        style="width:265px;" /><em class="em_user_manage">*</em> 
                    </td> 
                </tr> 
                <tr> 
                    <td nowrap="nowrap" style="text-align:right;">測試場景:</td> 
                    <td><input type="text" name="scene" style="width:265px;" 
                        value="${instance.scene}" /><em class="em_user_manage">*</em> 
                    </td> 
                </tr> 
                <tr> 
                    <td nowrap="nowrap" style="text-align:right;">測試目標:</td> 
                    <td><textarea type="text" name="goal" id="goal" cols="32" 
                            rows="7">${instance.goal}</textarea> 
                    </td> 
                </tr> 
                <tr> 
                    <td nowrap="nowrap" style="text-align:right;">測試說明:</td> 
                    <td><textarea type="text" name="description" id="description" 
                            cols="32" rows="7">${instance.description}</textarea> 
                    </td> 
                </tr> 
                <tr> 
                    <td colspan="2" align="center"><input type="hidden" 
                        name="extProcessDefinitionId" 
                        value="${instance.extProcessDefinitionId}" /><input type="hidden" 
                        name="signIn" value="${instance.signIn}" /><input type="hidden" 
                        name="definitionId" value="${instance.definitionId}" /><input 
                        type="button" value="確定" onclick="createInstance();" /><input 
                        type="button" value="取消" onclick="closeWindow();" /></td> 
                </tr> 
            </table> 
        </form> 

XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved