首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >带有java的HTML表单复制到剪贴板并清除命令?

带有java的HTML表单复制到剪贴板并清除命令?
EN

Stack Overflow用户
提问于 2018-06-12 00:54:17
回答 1查看 0关注 0票数 0

我在创建的表单上创建一个清晰的复制按钮工作时遇到困难。即时通讯希望从这里最好的HTML / Java脚本编写者获得帮助

我需要标签和复制框中的答案,我阅读了一些关于字符串的内容,这些字符串花了我3个小时的时间试图了解我还不知道。

这里是我创建ID的形式非常感谢所有我能得到的帮助

  [Form][1]

我无法获得标签和复制框上的答案。

EN

回答 1

Stack Overflow用户

发布于 2018-06-12 10:04:23

<head>
<body>

<h1></h1>
<h2>This is _______, can I have your name or User ID</h2>

<div>
  <form 

action="/action_page.php">
      <fieldset>
    <label for="fname">Name</label>
    <input type="text" id="fname" name="firstname">
<br>
    <label 

for="UserID">User ID</label>
    <input type="text" id="UserID" name="UserID">
    <br>
    <label for="Callbacknumber">Callback number</label>
    

<input type="text" id="Callbacknumber" name="Callbacknumber">
     <br>
    <label for="Email">Email</label>
    <input type="text" id="Email" 

name="Email">
     <br>
    <label for="legacy">yyyyy</label>
    <input type="text" id="legacy" name="legacy">
     <br>
    <label 

for="Existing/Related">Existing/Related</label>
    <input type="text" id="Existing/Related" name="Existing/Related">
    
     <br>
    <label 

for="Oloc">Office location:</label>
    <input type="text" id="Oloc" name="Oloc">
     <br>
    <label for="Cloc">Current Location</label>
    <input 

type="text" id="Cloc" name="Cloc">
    </fieldset>
    <br><fieldset>
    <label for="Appn">Application Name:</label>
    <input type="text" id="Appn" 

name="Appn">
    <br>
    <label for="Naffected">Number of Users Affected:</label>
    <input type="text" id="Naffected" name="Naffected">
    <br>
    

<label for="Mname">Machine name:</label>
    <input type="text" id="Mname" name="Mname">
    <br>
    <label for="KB">KB:</label>
    <input 

type="text" id="KB:" name="KB">
    <br>
    <label for="Errorm">Error message (if any):</label>
    <input type="text" id="Errorm:" name="Errorm">
    

</fieldset>
  </form>
  
  <button onclick="myFunction()">P1</button>

<div id="myP1">
<textarea rows="31" cols="72">
Name of Caller:
Best Callback 

No/Alternate Callback No:
Current Location:

Name of Team Lead or OIC/Time of notification:
Team Lead Notation 

template
Time notified of P1/P2:
Name of RSM/Time RSM was notified:
</textarea>
</div>

<script>
function myFunction() {
    var x = 

document.getElementById("myP1");
    if (x.style.display === "block") {
        x.style.display = "none";
    } else {
        x.style.display = "block";
    }
}
</script>
  
  <form action="/action_page.php">
   <label for="Errorm">TS/Additional details</label>
  <textarea name="comment" rows="4" cols="72" > 

</textarea>
  <input type="submit">
</form>
</div>


</body>
</html>

而不是P1没有显示其相反的内容。可以复制名称和内容。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/-100004852

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档