-3

您好,我已经使用 java 脚本插入了一个文本框,旁边是删除按钮符号。

现在我必须对该文本框实现一些逻辑来保存文本读取的数据。请你能建议我,这怎么可能?

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 = ""4"" title=""Please enter the Experimental Stressdays"" javascript:onfocusdown(/>"
4

1 回答 1

0

好的。我会在这里大胆猜测。
将此代码复制到page.html并告诉我们您是否正在寻找类似的内容。

<html>

<head>
    <script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(window).load(function(){
            $('#btncopy').on('click', function(){
                $('#txt2').val( $('#txt1').val() );
            });

            $('#btndelete').on('click', function(){
                $('#txt1').text('');
            });
        });
    </script>
</head>

<body>
<p>
    <div id="divform">
        <form class="myform">
            <textarea id="txt1">Here is the text the you want to copy.</textarea> 
        </form>
        <button id="btndelete">delete</button>
        <button id="btncopy">copy</button>
    </div>
</p>
<p>
    <div id="divclone">
        clones: 
        <form id="formclone">
            <textarea id="txt2">The text will be copied here.</textarea> 
        </form>
    </div>
</p>
</body>

</html>

编辑

刮那个。我刚看到你的评论。

Amit Bhargava,我想从文本框中读取用户输入的文本并将其保存到数据库中。请帮忙?

于 2012-04-24T14:22:52.480 回答