submit button grayed out

若如初见. 提交于 2019-12-06 10:17:40

You can use an onclick event to grab the button and set its disabled property to true.

<input type ='submit' value='submit'
       id="my_submit_button"  name='submit' 
       onclick="document.getElementById('my_submit_button').disabled = 'disabled'">

The syntax of the disabled attribute is pretty stupid, why it's not boolean I don't know but it is what it is:

http://www.w3schools.com/tags/att_input_disabled.asp

Just add the following onClick attribute to your button:

<input type="submit" value="submit" name="submit" 
onclick="
  if(!submitted) {
    this.value = 'Please wait...';
    this.disabled = true;
    submitted = true;
    return true;
  } else {
    return false;
  }
">
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!