我基本希望:
<input type="text" />
而我也希望,当用户投入价值时(。 如果违约值在Blur回归,这是理想的。
I don t想要提交违约值,如果它们离开并点击提交。
我用泽德语制作表格,想象我的解决办法完全可以装入泽德的表压器。
我找不到任何现有东西,因此我要求:
你们是否说了装饰? 或者帮助我做些什么?
我基本希望:
<input type="text" />
而我也希望,当用户投入价值时(。 如果违约值在Blur回归,这是理想的。
I don t想要提交违约值,如果它们离开并点击提交。
我用泽德语制作表格,想象我的解决办法完全可以装入泽德的表压器。
我找不到任何现有东西,因此我要求:
你们是否说了装饰? 或者帮助我做些什么?
Ok, I ve built a decorator which allows me to implement the jquery plugin Ololo posted. It checks to see if the element has a Label set, and if it does, defaults to that:
require_once Zend/Form/Decorator/Abstract.php ;
class Application_Form_Decorator_DefaultEnabledInput extends Zend_Form_Decorator_Abstract
{
private $attribs = array();
public function render($content)
{
$element = $this->getElement();
if(get_class($element) != Zend_Form_Element_Text ) throw new Exception("Application_Form_Decorator_DefaultEnabledInput only works on text fields");
$element->setAttrib( type , text );
$element->setAttrib( name , htmlspecialchars($element->getName()));
$element->setAttrib( value , htmlspecialchars($element->getValue()));
$attribs = ;
$default = $element->getLabel();
if($default)
{
$element->setAttrib( rel , $default);
$element->setAttrib( title , $default);
$class = $element->getAttrib( class );
$element->setAttrib( class , "$class hasDefault");
$default = "";
}
foreach($element->getAttribs() as $key => $val) $attribs .= "$key= $val ";
return "<input $attribs/>";
}
}
这使我能够用标语界定违约值(使用套工)。
$element = $this->createElement( text , suburb );
$element->setDecorators(array( DefaultEnabledInput ));
$element->setLabel( enter suburb here );
$this->addElement($element);
因此,我需要做的是确保将问询和假想列入网页,这部法典:
$(document).ready(function() {
// default values
$( .hasDefault ).each(function(){
$(this).defaultValue();
});
});
然后,在模板中,我可以展示这样的目标:
<?= $this->form->getElement( suburb ) ?>
正当使用 j Query plugins: default Value
泽斯德邮局在名称被定为具有外国性质(如“保”)和 com(”)的物品时,就放弃了一种例外(因为邮局(邮局)退回假)。 重新提出以下守则。
I have a Zend Framework application that is making use of jQuery UI. In my controllers, I am setting error/success messages with the FlashMessenger helper like this: // ExampleController.php $this-&...
I am going to be builiding a site like ebay - with all the features of ebay. Please note my payment method is limited to paypal. What would be the best PHP framework to use to build this quickly, ...
我把我的用心从使用QQL转向MySQL。 它与凯科特合作,现在不工作,因为我已经改变,使用MySQL。 这里的错误信息是:
Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...
Hey guys - here s a question on Zend Framework or better on MVC in general: I am asking myself for a quiet a long time now, if it is a good idea to push business objects (User, Team, etc.) to my ...
I m trying to create the same solutions as below, but using a simple MySQL query (instead of the static version used below where the words/tags are implemented in the code). The name of the MySQL ...
I hope that this is a quick question to answer. I am developing a form using Zend_Form, I have a number of Zend_Dojo_Form_Element_Textboxs to add to this form dynamically. These are added from rows ...