输入值不显示。这怎么可能? [英] Input value doesn't display. How is that possible?

查看:158
本文介绍了输入值不显示。这怎么可能?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这一定是我完成或正在做的完全愚蠢的事情,但我有一个值属性的输入,它根本不显示:

This must be something utterly stupid that I've done or am doing, but I have an input with a value attribute that simply isn't being displayed:

<div class="input text required">
  <label for="Product0Make">Make</label>
  <input name="data[Product][0][make]" type="text" maxlength="255" value="AC Make" id="Product0Make">
</div>

有没有人见过这个?我是否有某种我只是盲目的错字?无论它值什么,这里的CakePHP代码都会生成这一行:

Has anyone ever seen this before? Do I have some kind of typo that I'm just blind to? For whatever it may be worth, here's the CakePHP code that's generating this line:

<?php echo $this->Form->input( 'Product.' . $index . '.make', array( 'default' => $product['Product']['make'] ) ) ?>

我有一小部分文本输入,1个textarea和2个选择。没有任何文本输入值显示,但一切都很好。

I have a small form with a handful of text inputs, 1 textarea and 2 selects. None of the text input values display, but everything else is fine.

任何想法,将不胜感激。我甚至不能相信我不得不问这个问题,但是这让我很疯狂。 : - )

Any thoughts would be appreciated. I can't even believe I'm having to ask this question, but that's how crazy it's making me. :-)

推荐答案

我知道这是愚蠢的事情。有一点Javascript正在清除数据。清除在其他地方很有用,但是我不知道它正在执行,所以追踪时非常痛苦。一旦我在这种情况下阻止清除,我的价值实际上出现了。因为我在查看web检查器中的代码,我认为这将是一个实时视图,但我想这并不完全正确。

Argh. I knew this was going to be something beyond stupid. There was a bit of Javascript that was clearing data. The clearing was useful in other places, but I didn't know it was executing so it was a serious pain to track down. Once I prevented the clearing in this scenario, my values actually appeared. Because I was looking at the code in web inspector, I assumed that it would be a "live" view, but I guess that's not entirely true.

感谢您的帮助,每个人。为疯狂道歉。我在那里失去了一段时间。

Thanks for your help, everyone. Apologies for the lunacy. I was losing my mind for a while there.

这篇关于输入值不显示。这怎么可能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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