[英]How to show Error Message when special character and submit button is pressed without entering any value in text-box?
[英]How can I change this html code that take value from text-box after enter submit button?
我有一个通过事件功能连接到html表单的文本框和一个提交按钮。
HTML代码如下。 我想代替Pic.jpg,而是在输入“提交”按钮后选择文本框的值。
<html>
<body>
<img src="http://example.com/images/Pic.jpg"/>
</body>
</html>
换句话说,我想要地址的最后一部分,即图像名称,从文本框中获取值。
这是我的html中的Submit Button代码。
<input type="submit" id="Button1" onblur="ShowObject('Html_Form', 1);return false;" name="" value="Lookup" style="position:absolute;width:99px;height:25px;">
和文本框html代码:
<input type="text" id="Editbox1" style="position:absolute;line-" name="q" value="" placeholder="Enter You Code Here!">
您可以使用以下方法从发布的文本框中读取值:
$ _REQUEST,$ _ POST或$ _GET
<?php $pic_file_name = $_REQUEST['inputbox']; ?> <html> <body> <img src="http://example.com/images/<?php echo $pic_file_name; ?>"/> </body> </html>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.