启用只有在形式的值已更改“提交”按钮 [英] Enable 'submit' button only if a value in the form has been changed

查看:114
本文介绍了启用只有在形式的值已更改“提交”按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对含有显示值从我的数据库中检索,并提交按钮的文本字段一个网站一个PHP的形式。我想提交按钮默认被禁用,如果用户进行了更改表单文本字段中的一个唯一的点击。但是,如果他们要改回为默认值,按钮将自动再次禁用。任何帮助是AP preciated。

I have a php form for a website containing text fields which display values retrieved from my database and also a submit button. I would like the submit button to be disabled by default and to only be clickable if the user has made a change to one of the text fields in the form. However if they were to change it back to the default value, the button would automatically be disabled again. Any help is appreciated.

推荐答案


  • 声明一个变量每个文本框

  • 然后指定你从数据库中检索到文本框的值和变量...

  • 在Button_Click的时间比较文本框的值与变量

  • 如果都是相同的,然后就没有编辑的发生

  • Declare a Variables for each Text box
  • Then assign the values that you Retrieving from database to the text box and a Variables...
  • At the time of Button_Click compare the Value of text box with the Variables
  • If BOTH are Same then there is no EDIT's occur
  • 这就是

    这篇关于启用只有在形式的值已更改“提交”按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆