本文整理汇总了PHP中RequiredFields::javascript方法的典型用法代码示例。如果您正苦于以下问题:PHP RequiredFields::javascript方法的具体用法?PHP RequiredFields::javascript怎么用?PHP RequiredFields::javascript使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequiredFields
的用法示例。
在下文中一共展示了RequiredFields::javascript方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: javascript
/**
* Check if the submitted member data is valid (client-side)
*
* @param array $data Submitted data
* @return bool Returns TRUE if the submitted data is valid, otherwise
* FALSE.
*/
function javascript()
{
$js = parent::javascript();
// Execute the validators on the extensions
if ($this->extension_instances) {
foreach ($this->extension_instances as $extension) {
if (method_exists($extension, 'hasMethod') && $extension->hasMethod('updateJavascript')) {
$extension->updateJavascript($js, $this->form);
}
}
}
return $js;
}
示例2: javascript
function javascript()
{
$js = '';
Requirements::customScript($js, "ModuleProductEmail");
return parent::javascript();
}
示例3: javascript
function javascript()
{
$js = <<<JS
\t\t\$('PollForm_Poll_PollChoices').requiredErrorMsg = 'Please select at least one option.';
\t\tif (jQuery('#PollForm_Poll_PollChoices').find('input[checked]').length==0) {
\t\t\tvalidationError(jQuery('#PollForm_Poll_PollChoices')[0], 'Please select at least one option.', 'required');
\t\t}
JS;
return $js . parent::javascript();
}
示例4: javascript
function javascript()
{
$codes = DB::query("SELECT \"Code\" FROM ModuleProduct WHERE ModuleProduct.ID <> " . ($this->currentID - 0))->column();
if ($codes) {
$js = '
jQuery(document).ready(
function() {
var AddingModuleProductCodes = new Array(\'' . implode("','", $codes) . '\');
jQuery("#Code input").change(
function(){
var val = jQuery("#Code input").val();
jQuery("#Code input").css("color", "green");
for(i = 0; i < AddingModuleProductCodes.length; i++) {
if(AddingModuleProductCodes[i] == val) {
i = 999999999;
alert("Your code \'"+val+"\' is already in use - please use an alternative code.");
jQuery("#Code input").focus().css("color", "red");
}
}
}
);
}
);
';
Requirements::customScript($js, "AddingModuleProductCodes");
}
return parent::javascript();
}