【问题标题】:Why the disabled="disabled" is not working in following scenario?为什么 disabled="disabled" 在以下情况下不起作用?
【发布时间】:2013-09-19 07:00:27
【问题描述】:

我的 smarty 模板代码如下。 disable="disabled" 属性不适用于文本字段。你能告诉我为什么它不起作用吗?

<input type="text" name="{$sheet_type}_{$subject_topic_data.subject_id}_{$topic_diff_level_data.topic_id}_{$key_diff_lvl}" id="{$sheet_type}_{$subject_topic_data.subject_id}_{$topic_diff_level_data.topic_id}_{$key_diff_lvl}"  maxlength="3" class="mini" value="{$diff_level.added_no_questions}" disabled="disabled">

【问题讨论】:

  • 尝试只使用disabled 而不是disabled='disabled'
  • 如果 Smarty 在某种程度上对问题至关重要,请描述方法并提供更多详细信息;如果没有,请删除标签。如果使用 PHP 是相关的,请描述如何使用;如果没有,请显示一个实际重现问题的纯 HTML 示例(没有 PHP 变量)。解释您所说的“不工作”是什么意思,以及您用于发短信的浏览器。

标签: html smarty disabled-input


【解决方案1】:
<input type="text" name="{$sheet_type}_{$subject_topic_data.subject_id}_{$topic_diff_level_data.topic_id}_{$key_diff_lvl}" id="{$sheet_type}_{$subject_topic_data.subject_id}_{$topic_diff_level_data.topic_id}_{$key_diff_lvl}"  maxlength="3" class="mini" value="{$diff_level.added_no_questions}" disabled="disabled">

像这样检查..它工作正常。

你也可以只提到disabled,但据我所知,在XHTML中,属性最小化是被禁止的,disabled属性必须定义为&lt;input disabled="disabled" /&gt;

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-05-26
    • 2014-09-09
    • 2011-08-28
    • 1970-01-01
    • 2023-03-18
    • 2015-08-16
    • 2011-09-25
    • 1970-01-01
    相关资源
    最近更新 更多