AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 26.01.2012, 05:19   #1  
Blog bot is offline
Blog bot
Участник
 
25,644 / 848 (80) +++++++
Регистрация: 28.10.2006
Все о Microsoft Dynamics CRM: Сделать поле динамически обязательным или рекомендуемым
Источник: http://ms-dynamics-crm.com.ua/2012/0...ally-required/
==============

Данная функция делает поле динамически обязательным или рекомендуемым. Скопируйте функцию в событие OnLoad и вызовите как указано в комментариях в примере:

//****************************************************gSetFieldRequired = function (field, src, height, width){/*Description: This function is used to dynamically make a field required, recommended in JavaScriptParams:    field  = name of the fieldsrc  = url with image eg. /_imgs/frm_required.gifheight =  number, optional e.g. 50width  =  number optional e.g. 50Returns:   nothingExample 1 :  gSetFieldRequired(, 'new_partweight', 'required');     = add *-sign to labelExample 2:   gSetFieldRequired( 'new_partweight', 'recommended');     = add +-sign to labelExample 3:   gSetFieldRequired(, 'new_partweight', 'none');      = no imageCalls:    nothingAuthor:  Geron Profet*/var attribute = document.getElementById(field);if (!attribute){return};switch(src.toLowerCase()){case 'required':src = '/_imgs/frm_required.gif';attribute.setAttribute('req', 2);break;case 'recommended':src = '/_imgs/frm_recommended.gif';attribute.setAttribute('req', 1);break;case 'none':src = ''attribute.setAttribute('req', 0);break;}//if src is passed add imageif (src != '') {var img = document.createElement("img");img.setAttribute('src', src);//check if custom height and widthif (height && height != '' ){img.setAttribute('height', height);}if (width && width != '' ){img.setAttribute('height', width);}//img.setAttribute('width', width);var objLabel = document.getElementById(field+'_c');if (objLabel){objLabel.appendChild(img)};}else{document.getElementById(field+'_c').innerHTML = document.getElementById(field+'_c').innerText;}}Источник



Источник: http://ms-dynamics-crm.com.ua/2012/0...ally-required/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
Microsoft Dynamics CRM Team Blog: Update Rollup 3 for Microsoft Dynamics CRM 2011 Blog bot Dynamics CRM: Blogs 3 03.08.2011 09:11
Microsoft Dynamics CRM Team Blog: Microsoft Dynamics CRM 2011 ~ Book Club Blog bot Dynamics CRM: Blogs 0 02.02.2011 00:16
Jim Wang: Software Advice: 15 Favourites Microsoft Dynamics CRM Industry Solutions Blog bot Dynamics CRM: Blogs 2 26.08.2010 02:09
Microsoft Dynamics CRM Team Blog: Troubleshooting the Microsoft Dynamics CRM E-mail Router Blog bot Dynamics CRM: Blogs 0 09.01.2009 06:03
Microsoft Dynamics CRM Team Blog: Highlight: Available downloads for Microsoft Dynamics CRM Blog bot Dynamics CRM: Blogs 0 05.11.2008 22:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 06:56.