Hi all,
i create a add email address button which is useful to add the multiple email address on clicking on the add button... i also put cancel button near to text box which will clear new add email text
so i show u steps how to create this
1) create the one custom code field and give it proper name like email_add_c
2) in code write following code
PHP Code:
echo "
<script>
function showemail()
{
var btn=document.getElementById('addbutton');
btn.disabled='true';
var x=document.getElementById('productLine').insertRow(-1);
var dd=x.insertCell(0);
dd.innerHTML='<div id=\'myTable\'><input type='text' id=\'emailtext\' name=\'emailtext\'><input type=\'button\' value=\'Cancel\' onclick=\'cancel(this)\'></div>';
}
function cancel(ln){
var obj = ln.parentNode.parentNode.rowIndex;
document.getElementById('productLine').deleteRow(obj);
var btn=document.getElementById('addbutton');
btn.disabled='';
}
</script>";
3) just add this field in ur editview and detailview layout
4) after adding this just open custom/module/{U r Module name}/metadata/editviewdef.php
write this code after ur new added custom code field (email_add_c)
PHP Code:
8 =>
array (
0 =>
array (
'name' => 'new_email_c',
'label' => 'LBL_PRE_CMT',
'customCode' => '<input type=\'button\' value=\'Add Email\' onclick=\'showemail();\'><table width=\'100%\' border=\'0\' cellspacing=\'0\' cellpadding=\'0\' id=\'productLine\'></table>',
),
1 => NULL,
),
i add this code because my enhanced studio not full version so it is not display add email button in the create form..
5) rebuild the sugar
i hope this code help u to add the multiple email, product, address etc..
any query please ask me and if u have any suggestion than also let me know
pls reply if its work for u
Bookmarks