You need to sign in to do that
Don't have an account?

Onchange in lookup field
Hi,
We are developing a SControl that use a custom field with lookup this is the code:
Our problem is when the value search is inserted. The onchange of the input camp_lkid don't work.
Is there any problem in the code? is it no posible to use onchange in the camp_lkid field? How can we captured this event?
Thanks for all.
We are developing a SControl that use a custom field with lookup this is the code:
Code:
<td class="data2Col" style="width:82%;border-bottom:1px solid #E3DEB8"> <input id="camp_lkid" type="hidden" value="000000000000000" name="camp_lkid" onchange ="cargarEstados();" /> <input id="camp_lkold" type="hidden" value="" name="camp_lkold" /> <input id="camp_lktp" type="hidden" value="701" name="camp_lktp"/> <input id="camp_lspf" type="hidden" value="0" name="camp_lspf"/> <input id="camp_mod" type="hidden" value="0" name="camp_mod"/> <span class="lookupInput"> <input id="camp" type="text" value="" tabindex="2" size="20" onchange="getElementByIdCS('camp_lkid').value='';getElementByIdCS('camp_mod').value='1';" name="camp" maxlength="255"/> <a id="camp_lkwgt" title="Campaña" tabindex="2" onclick="setLastMousePosition(event);" href="JavaScript: openLookup('/_ui/common/data/LookupPage—lkfm=editPage&lknm=camp&lktp=' + document.getElementById('camp_lktp').value,670,document.getElementById('camp_mod').value,'&lksrch=' + escapeUTF(document.getElementById('camp').value));"> <img alt="Buscar" src="{!Scontrol.JavaArchive}"/> </a> </span> </td>
Our problem is when the value search is inserted. The onchange of the input camp_lkid don't work.
Is there any problem in the code? is it no posible to use onchange in the camp_lkid field? How can we captured this event?
Thanks for all.
We are using this SControl in a new page, we are replacing the "new" bottom target of a object for our SObject.
Also, lookup pages are changing pretty fundamentally, and your hack is not guaranteed to work forever, so be forewarned.