input 相关问题

输入通常与用户输入有关,即与用户提供给正在运行的应用程序的数据有关。在许多系统中,此输入被认为是潜在危险的,需要进行清理以确保用户未将可运行代码注入应用程序。

无法动态设置输入(月份)值Vue 3 [已关闭]

我有道具,默认值来自它们。 我正在使用 shadcn-vue,所以我不会使用...

回答 1 投票 0

CodeMirror 6,如何在输入/更新/更改事件上获取编辑器值?

我希望 CodeMirror 6 编辑器实例的内容/值反映在外部变量中,当文本更改时变量更改/同步。 如何在 CodeMirror 6 中做到这一点? 伪鳕鱼...

回答 1 投票 0

无法动态设置输入(月份)值Vue 3

我有道具,默认值来自它们。 我正在使用 shadcn-vue,所以我不是你...

回答 1 投票 0

我无法在下一行中打印 input() 的用户输入

我想执行:- print(input('嘿,你好吗???\n')); 用户 ipout 是:- 我做得很好,谢谢...... 哦执行我得到:- 嘿,你好吗???我很好,谢谢...... 我是...

回答 1 投票 0

如何将输入值(类型=文本)作为JavaScript函数结果放入HTML中

我很好奇如何将输入值(input=text)作为JS函数结果放入HTML中。 我目前正在使用这个 JavaScript 函数; 函数 maketeststring(长度) { 让结果=''; 常量字符...

回答 1 投票 0

在PowerShell中输入模拟(Win + A)

我有一个Python脚本来使用输入模拟启用/禁用飞行模式,效果很好: Win + A:打开操作中心 右箭头(两次):导航至飞机切换 空格键:按...

回答 1 投票 0

选择输入法触摸时未打开 -

我有一个摄像头/演示应用程序。 在白板工具(从左侧工具栏底部按钮打开)中,我无法获取颜色选择器或选择要在 touchstart 事件或任何

回答 1 投票 0

如何获取addonAfter值来加入react antd中的Input值?

我有一个 React Antd Form.List,其中添加了 x 个 组件。 当我记录从表单发布的值时,它只返回输入值。我想要 addonAfter 值

回答 1 投票 0

浏览器自动完成输入

我需要建议!我想在 PS 结账表单中禁用浏览器自动填充功能 我承认我已经尝试过: -autocomplete="off" 在表单和所有输入上不起作用; 我尝试更换

回答 1 投票 0

Cakephp 输入表单视图作为无序列表

我正在使用 cakephp 2.x 开发一个网站。 现在,我使用 Cakedc/search 创建一个表单。该表单有输入(选择/下拉列表)。 但列表太长了,所以我希望下拉列表显示为 unor...

回答 1 投票 0

不同浏览器中的日期输入格式

React 组件中有一个这种形式的日期输入: React 组件中有一个这种形式的日期输入: <input className="my-class" type="date" name="dateFrom" data-testid="dateFrom" value={dataFields.dateFrom} onChange={(e) => setDataFields({ ...dataFields, dateFrom: e.target.value }) } disabled={disabledFields.dateFrom} /> 用Chrome打开,有一个占位符dd/mm/yyyy,用Firefox打开,月份和日期互换了:mm/dd/yyyy。 我想对所有浏览器使用第一种格式 (dd/mm/yyyy)。 所以我添加了一个占位符,但它似乎忽略了它,有没有办法一直显示该格式? <input className="my-class" placeholder="dd/mm/yyyy" // added this line type="date" name="dateFrom" data-testid="dateFrom" value={dataFields.dateFrom} onChange={(e) => setDataFields({ ...dataFields, dateFrom: e.target.value }) } disabled={disabledFields.dateFrom} /> 日期输入中的占位符文本取决于您的浏览器区域设置。例如,如果您将浏览器的语言设置为德语,则日期输入将显示 TT.MM.JJJJ(如 dd.mm.yyyy),在英语(美国)上显示为 mm/dd/yyyy,在英语(英国)上显示为 dd/mm/yyyy。因此,您不能强制它采用不同的显示格式。 但是提交的值将始终采用以下格式:yyyy-mm-dd: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date 注意:显示的日期格式将与实际值不同 - 显示的日期是根据用户浏览器的区域设置进行格式化的,但解析的值始终是格式化的 yyyy-mm-dd。

回答 1 投票 0

Java 上是否可以立即将输入转换为双精度数组?

我的微积分课程项目是创建一个程序来查找任意两条直线或平面的交点。然而,我已经一年没有编码了,所以我忘记了很多编码。我觉得我的...

回答 1 投票 0

在文本输入字段中输入时,打印在div中输入的内容

我有一个网站,其中有一个空框和一个输入文本框。 我希望能够在该输入框中输入一些内容并将其打印在空框中。 超文本标记语言 我有一个网站,其中有一个空框和一个输入文本框。 我希望能够在该输入框中输入一些内容并将其打印在空框中。 HTML <div class='printchatbox'></div> 这是空盒子并且 <input type='text' name='fname' class='chatinput'> 这是输入框。 CSS .printchatbox {border-width:thick 10px;border-style: solid; background-color:#fff; line-height: 2;color:#6E6A6B;font-size: 14pt;text-align:left;float: middle; border: 3px solid #969293;width:40%;} 如果有人能告诉我如何做到这一点,我将不胜感激。 谢谢 您使用 onkeyup 事件 使用 ids 进行搜索要容易得多。将 id 添加到您的元素,如下所示: <div class='printchatbox' id='printchatbox'></div> <input type='text' name='fname' class='chatinput' id='chatinput'> JS const inputBox = document.getElementById('chatinput'); const printBox = document.getElementById('printchatbox'); inputBox.addEventListener('keyup', function (event) { printBox.innerHTML = inputBox.value; }) 这是一个实例 http://jsfiddle.net/3kpay/ <div class='printchatbox' id='printchatbox'></div> <input type='text' name='fname' class='chatinput' onkeyUp="document.getElementById('printchatbox').innerHTML = this.value" /> 有很多方法可以完成此任务,最简单的可能是使用 jQuery。在下面的示例中,我使用 jQuery keyUp() 函数来监听键盘事件,然后将更新后的值写入 .printChatBox <!DOCTYPE html> <html> <head> <script src="http://code.jquery.com/jquery-1.9.0.min.js"></script> </head> <body> <div class='printchatbox'>CHANGE ME</div> <input type='text' name='fname' class='chatinput'> <script type="script/javascript"> $('.chatinput').keyup(function(event) { newText = event.target.value; $('.printchatbox').text(newText); }); </script> </body> </html> 我在这里发布了一个工作示例:http://jsbin.com/axibuw/1/edit 在您的 HTML 中, <div id='printchatbox'></div> <br> <input type='text' id='fname' class='chatinput' onkeyup="annotate()"> 在 JS 中, function annotate(){ var typed= document.getElementById("fname").value; document.getElementById("printchatbox").innerHTML= typed; } 点击此处查看现场演示 Angular JS 只需两行代码即可完成此操作: 只需像导入其他库一样导入 Angular JS 即可: <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"> 然后,在您的第一个 div(您从中复制的位置)上: <input type="text" ng-model="myID"> </input> 然后,在您要显示内容的地方:只需写: <div> {{myID}}</div> 这是我找到的最好的解决方案!

回答 5 投票 0

日历(输入类型日期)关闭时如何调用API?

如何确保仅在从日历中选择日期或手动更改日期字段后按下 Enter 按钮时调用我的 API,而不是在最近的每次更改时调用...

回答 1 投票 0

如何将apk文件上传到HTML/PHP中的输入文件

当我将任何大于 16MB 的 apk 文件上传到 (在 内)并点击提交按钮时,网络只会加载一些然后刷新... 当我将任何大于 16MB 的 apk 文件上传到 <input type=‘file’>(在 <form action=“” method=“post”> 内)并点击提交按钮时,网络只会加载一些内容,然后刷新页面并重置之前放入其他输入的所有数据就好像什么都没发生一样。 或者我们可以换句话说,我怎样才能使表单能够传输大尺寸文件,例如apks。 我在google、youtube上搜索过,没有发现与该问题相关的任何内容。 可能的问题,例如表单设置不正确、缺少 enctype="multipart/form-data" 或 PHP 代码中的问题可能是罪魁祸首。如果您的所有 HTML 和 PHP 代码看起来都是正确的,但您仍然遇到上传限制,则需要考虑的两个因素是 upload_max_filesize 和 post_max_size。这些限制是在服务器的 php.ini 文件中设置的,如果您遇到问题,增加它们的值可能会解决您的问题。通常,此问题会显示错误。您可以参考此页面以进一步阅读有关在 PHP 中配置文件上传设置的信息。

回答 1 投票 0

如何将fieldset标签中的input标签设为必填?

使用 html 和 javascript 我正在尝试制作一个注册页面,但我无法制作 html 代码中所需的输入标记。下面的代码不起作用: 使用 html 和 javascript 我正在尝试制作一个注册页面,但我无法制作 html 代码中所需的输入标记。下面的代码不起作用: <input type="email" required name="email" placeholder="Email"/> 这是我的 html、css 和 java 脚本代码: //jQuery time var current_fs, next_fs, previous_fs; //fieldsets var left, opacity, scale; //fieldset properties which we will animate var animating; //flag to prevent quick multi-click glitches $(".next").click(function () { if (animating) return false; animating = true; current_fs = $(this).parent(); next_fs = $(this).parent().next(); //activate next step on progressbar using the index of next_fs $("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active"); //show the next fieldset next_fs.show(); //hide the current fieldset with style current_fs.animate({opacity: 0}, { step: function (now, mx) { //as the opacity of current_fs reduces to 0 - stored in "now" //1. scale current_fs down to 80% scale = 1 - (1 - now) * 0.2; //2. bring next_fs from the right(50%) left = (now * 50) + "%"; //3. increase opacity of next_fs to 1 as it moves in opacity = 1 - now; current_fs.css({ 'transform': 'scale(' + scale + ')', 'position': 'absolute' }); next_fs.css({'left': left, 'opacity': opacity}); }, duration: 800, complete: function () { current_fs.hide(); animating = false; }, //this comes from the custom easing plugin easing: 'easeInOutBack' }); }); $(".previous").click(function () { if (animating) return false; animating = true; current_fs = $(this).parent(); previous_fs = $(this).parent().prev(); //de-activate current step on progressbar $("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active"); //show the previous fieldset previous_fs.show(); //hide the current fieldset with style current_fs.animate({opacity: 0}, { step: function (now, mx) { //as the opacity of current_fs reduces to 0 - stored in "now" //1. scale previous_fs from 80% to 100% scale = 0.8 + (1 - now) * 0.2; //2. take current_fs to the right(50%) - from 0% left = ((1 - now) * 50) + "%"; //3. increase opacity of previous_fs to 1 as it moves in opacity = 1 - now; current_fs.css({'left': left}); previous_fs.css({'transform': 'scale(' + scale + ')', 'opacity': opacity}); }, duration: 800, complete: function () { current_fs.hide(); animating = false; }, //this comes from the custom easing plugin easing: 'easeInOutBack' }); }); $(".submit").click(function () { return false; }) /*custom font*/ @import url(https://fonts.googleapis.com/css?family=Montserrat); /*basic reset*/ * { margin: 0; padding: 0; } html { height: 100%; /*Image only BG fallback*/ /*background = gradient + image pattern combo*/ background: linear-gradient(rgba(196, 102, 0, 0.6), rgba(155, 89, 182, 0.6)); } body { font-family: montserrat, arial, verdana; } /*form styles*/ #msform { width: 400px; margin: 50px auto; text-align: center; position: relative; } #msform fieldset { background: white; border: 0 none; border-radius: 3px; box-shadow: 0 0 15px 1px rgba(0, 0, 0, 0.4); padding: 20px 30px; box-sizing: border-box; width: 80%; margin: 0 10%; /*stacking fieldsets above each other*/ position: relative; } /*Hide all except first fieldset*/ #msform fieldset:not(:first-of-type) { display: none; } /*inputs*/ #msform input, #msform textarea { padding: 15px; border: 1px solid #ccc; border-radius: 3px; margin-bottom: 10px; width: 100%; box-sizing: border-box; font-family: montserrat; color: #2c3e50; font-size: 13px; } /*buttons*/ #msform .action-button { width: 100px; background: #27ae60; font-weight: bold; color: white; border: 0 none; border-radius: 1px; cursor: pointer; padding: 10px 5px; margin: 10px 5px; } #msform .action-button:hover, #msform .action-button:focus { box-shadow: 0 0 0 2px white, 0 0 0 3px #27ae60; } /*headings*/ .fs-title { font-size: 15px; text-transform: uppercase; color: #2c3e50; margin-bottom: 10px; } .fs-subtitle { font-weight: normal; font-size: 13px; color: #666; margin-bottom: 20px; } /*progressbar*/ #progressbar { margin-bottom: 30px; overflow: hidden; /*CSS counters to number the steps*/ counter-reset: step; } #progressbar li { list-style-type: none; color: white; text-transform: uppercase; font-size: 9px; width: 33.33%; float: left; position: relative; } #progressbar li:before { content: counter(step); counter-increment: step; width: 20px; line-height: 20px; display: block; font-size: 10px; color: #333; background: white; border-radius: 3px; margin: 0 auto 5px auto; } /*progressbar connectors*/ #progressbar li:after { content: ""; width: 100%; height: 2px; background: white; position: absolute; left: -50%; top: 9px; z-index: -1; /*put it behind the numbers*/ } #progressbar li:first-child:after { /*connector not needed before the first step*/ content: none; } /*marking active/completed steps green*/ /*The number of the step and the connector before it = green*/ #progressbar li.active:before, #progressbar li.active:after { background: #27ae60; color: white; } <!DOCTYPE html> <html> <head> <link rel="stylesheet" href="{% static 'CSS/signup.css' %}"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquerymobile/1.4.5/jquery.mobile.min.js"></script> </head> <body> <form method="post" id="msform"> <!-- progressbar --> <ul id="progressbar"> <li class="active">Account Setup</li> <li>Social Profiles</li> <li>Personal Details</li> </ul> <!-- fieldsets --> <fieldset> <h2 class="fs-title">Create your account</h2> <h3 class="fs-subtitle">This is step 1</h3> <input type="email" required name="email" placeholder="Email"/> <input type="password" required name="pass" required placeholder="Password"/> <input type="password" required name="cpass" required placeholder="Confirm Password"/> <input type="button" name="next" class="next action-button" value="Next"/> </fieldset> <fieldset> <h2 class="fs-title">Social Profiles</h2> <h3 class="fs-subtitle">Your presence on the social network(Pleas Put Link)</h3> <input type="url" name="twitter" placeholder="Twitter"/> <input type="url" name="facebook" placeholder="Facebook"/> <input type="url" name="gplus" placeholder="Google Plus"/> <input type="button" name="previous" class="previous action-button" value="Previous"/> <input type="button" name="next" class="next action-button" value="Next"/> </fieldset> <fieldset> <h2 class="fs-title">Personal Details</h2> <h3 class="fs-subtitle">We will never sell it</h3> <input type="text" required name="fname" placeholder="First Name"/> <input type="text" required name="lname" placeholder="Last Name"/> <input type="text" required name="phone" placeholder="Phone"/> <textarea name="address" placeholder="Address"></textarea> <input type="button" name="previous" class="previous action-button" value="Previous"/> <input type="submit" name="submit" class="submit action-button" value="Submit"/> </fieldset> </form> </body> </html> 我想创建电子邮件和密码,并确认密码所需的输入,以便用户在不填写此表单的情况下无法进入下一个字段集。 请帮助我并告诉我我的问题是什么以及为什么 required 和 type="email" 在 <input type="email" required name="email" placeholder="Email"/> 中不起作用? 另外,很抱歉我的问题写错了。 据我搜索和理解,使归档成为必需的唯一方法是使用 javascript 获取值并检查它,如果它没有正确的格式,则让用户更改输入,否则提交用户输入。 了解更多信息: 使用 JavaScript 检查 Html 值 <input> 标签是一个自关闭标签,不应有 / 来关闭。请参阅此处了解更多详情。 尝试这样: <input type="email" required name="email" placeholder="Email"> 输入标签有一个名为“required”的属性。如果输入标签具有该属性,则必须在提交之前填写。 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>Document</title> </head> <body> <form> <label>This text field must be filled out before submitting.</label> <input type="text" required /> <input type="submit" /> </form> </body> </html>

回答 3 投票 0

输入“未定义”

我花了几天时间尝试解决最近的 javascript 项目中的“输入未定义”问题。近 61,000 条搜索结果表明其他人也做过同样的事情。 我最初...

回答 1 投票 0

输入数据未定义

我有一个带有输入的表格。 1 球 10欧元 我有一个带有输入的表格。 <tr id="1"> <th>1</th> <th>ball</th> <th>10euro</th> <th><input type="text" class="input col-xs-1 sum" value="1"></th> <th style="text-align:center;"><i class="fa fa-shopping-cart fa-2x"></i></th> <th style="text-align:center;"><i class="fa fa-times fa-2x" id="addproduct1"></i></th> </tr> 还有脚本 var data = $("#1.sum").value; alert(data); 但是数据始终是未定义/空的。我尝试的每一种方法都是空/未定义的。你能帮我告诉我出了什么问题吗? 您的选择器很接近,但是错误。如果 ID 和类之间没有空格,则您正在寻找 ID 为 1 且类为 sum 的元素 - 您想要: var data = $("#1 .sum").val(); 现在它会查找类为 sum 的元素,该元素是 ID 为 1 的元素的子元素。 此外,.value是DOM元素上的一个属性,上面有一个jQuery元素,所以你想要.val() 错误来自您的 HTML。更改您的输入类型属性。 (不要使用通用的“文本”,而使用“数字”。) 改变这个: 对此: 定义输入字段将消除“未定义”和“NaN”响应。

回答 2 投票 0

如果选择了文件,则显示 html/javascript 中的内容

我希望如果用户在 内选择图像,然后在输入旁边显示该图像,以便用户知道图片已成功上传。我想...

回答 1 投票 0

如何让提供者只重建一个小部件

在我的 Flutter 应用程序中,我有一个包含各种 TextFormFields 的表单,每个表单域都有一个麦克风来转录所说的内容。 我用 SpeechToTextProvider 实现了它。 当我按下麦克风时,它会写...

回答 2 投票 0

© www.soinside.com 2019 - 2024. All rights reserved.