Hi all.
I have this JavaScript function that copy the value ( selected in a select open in a window popup), in the hidden main form field.
I need this changes:
1) If the popup window is not requested by the user, the hidden main form field take value = 0;
2) If the window is open to force the user to make a choice within the select.
Can you help me?
Thanks
I have this JavaScript function that copy the value ( selected in a select open in a window popup), in the hidden main form field.
I need this changes:
1) If the popup window is not requested by the user, the hidden main form field take value = 0;
2) If the window is open to force the user to make a choice within the select.
Can you help me?
Thanks
Code:
<script language="javascript" type="text/javascript"> <!-- function setValue(selObj) { if (!window.opener || selObj.selectedIndex <= 0) return; var vl = ""; var opts = selObj.options; for ( n = 0 ; n < opts.length ; n++ ) { if (opts[n].selected) { if (vl.length > 0) vl += ", "; vl += opts[n].value; } } window.opener.document.Qform.NASCOSTO.value = selObj.value; window.close(); } // --> </script>
Comment