2012-04-16 56 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