2012-04-16 38 views
0

對於ASPX而言,我是一個新手,我在開發代碼時遇到了問題。請看下面。如何設置旁邊的文本框來刪除按鈕?如何通過使用Javascript插入文本框

testTypeNode.Text = testTypeNode.Text & "" & _ 
        " <img src=""../images/delete_16x.ico""" & _ 
        " style=""text-align:bottom; cursor:pointer;"" alt=""Delete TestType""" & _ 
        " title=""Delete TestType"" onclick=""javascript:if(confirm('`enter code here`Are you sure you want to delete? Any running tests will be aborted!'))" & _ 
        " {" & ClientScript.GetPostBackEventReference(btnDeleteTestType, "" & sequenceNode.Value.ToString & _ 
        WordSeparationChar & testTypeNode.Value.ToString & "") & ";};"" />" 
+0

你想這與後回服務器發生,或在客戶端? – mellamokb 2012-04-16 17:14:46

+0

回覆後,謝謝 – 2012-04-16 17:28:35

+0

你只是試圖讓一個文本框旁邊的刪除按鈕? (對不起,語言障礙在這裏) – 2012-04-16 18:08:55

回答

0

答案是:

testTypeNode.Text = testTypeNode.Text & "" & _ 
                  " <img src=""../images/delete_16x.ico""" & _ 
                  " style=""text-align:bottom; cursor:pointer;"" alt=""Delete TestType""" & _ 
                  " title=""Delete TestType"" onclick=""javascript:if(confirm('Are you sure you want to delete? Any running tests will be aborted!'))" & _ 
                  " {" & ClientScript.GetPostBackEventReference(btnDeleteTestType, "" & sequenceNode.Value.ToString & _ 
                  WordSeparationChar & testTypeNode.Value.ToString & "") & ";};"" />" & _ 
                  " <input type = ""text"" id = ""txtExperimentalStressdays"" name =""ExperimentalStressdays"" size = ""5"" title=""Please enter the Experimental Stressdays"" onclick="javascript:IsNumeric()/>" 
+0

與上述答案的另一個問題前進。我如何設置上述文本框id =「」txtExperimentalStressdays「」的可見性條件。我希望通過使用這種條件隱藏,如果testdata ='是'那麼txtExperimentalStressdays.visible = true否則txtExperimentalStressdays.visible = false結束如果上述代碼不允許我做這種任務請幫助。 – 2012-04-17 13:50:47

+0

面對上述代碼的第二個問題是:如何驗證txtExperimentalStressdays數據是否爲數字?請幫忙 – 2012-04-17 13:52:07

相關問題