From ee8424c1ba924c08c1d08cacab746def1e0d89ca Mon Sep 17 00:00:00 2001 From: Tim Mallezie Date: Thu, 21 May 2015 17:52:05 +0200 Subject: [PATCH] use addfield in website form --- CRM/Contact/Form/Edit/Website.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/CRM/Contact/Form/Edit/Website.php b/CRM/Contact/Form/Edit/Website.php index ffa3244fa4..faf7c292c6 100644 --- a/CRM/Contact/Form/Edit/Website.php +++ b/CRM/Contact/Form/Edit/Website.php @@ -59,18 +59,13 @@ class CRM_Contact_Form_Edit_Website { $form->applyFilter('__ALL__', 'trim'); //Website type select - $form->addSelect("website[$blockId][website_type_id]", array('entity' => 'website', 'class' => 'eight')); - + $form->addField("website[$blockId][website_type_id]", array('entity' => 'website', 'class' => 'eight')); //Website box - $form->addElement('text', "website[$blockId][url]", ts('Website'), - array_merge( - CRM_Core_DAO::getAttribute('CRM_Core_DAO_Website', 'url'), - array( - 'onfocus' => "if (!this.value) { this.value='http://';} else return false", - 'onblur' => "if ( this.value == 'http://') { this.value='';} else return false", - ) - ) - ); + $form->addField("website[$blockId][url]", array( + 'entity' => 'website', + 'onfocus' => "if (!this.value) { this.value='http://';} else return false", + 'onblur' => "if ( this.value == 'http://') { this.value='';} else return false", + )); $form->addRule("website[$blockId][url]", ts('Enter a valid web location beginning with \'http://\' or \'https://\'. EXAMPLE: http://www.mysite.org/'), 'url'); } -- 2.25.1