Page 1 of 1

Default value in subform 1st row

Posted: Wed Apr 18, 2012 6:03 pm
by ruiascensao
Hi,

How can I have a default value only in the subform 1st row?

Thank you.
Best Regards,
Rui

Re: Default value in subform 1st row

Posted: Mon Apr 23, 2012 4:25 am
by admin
Rui,

Put this in the JavaScript part of the Form..

Code: Select all

function nuLoadThis(){

	 var subFormName = '';
	 document.getElementById(subFormName'+'0000'+'fieldname1').value = 'hello';
	 document.getElementById(subFormName'+'0000'+'fieldname2').value = 'world';

 }


Steven

Re: Default value in subform 1st row

Posted: Mon Apr 23, 2012 6:57 pm
by ruiascensao
Hi Steven,


If the 1st field of the subform is a lookup and I wan't to use the "code", I tried:

Code: Select all

document.getElementById('codeFMinvoice_item0001tri_product_id').value = '14325';
But it doesn't work.

Thank you forl your help!

Best Regards,
Rui

Re: Default value in subform 1st row

Posted: Tue Apr 24, 2012 12:52 am
by admin
Rui,

The easiest way is to manually fill out ALL three fields used by the lookup.

eg.
FMinvoice_item0001tri_product_id
codeFMinvoice_item0001tri_product_id
descriptionFMinvoice_item0001tri_product_id

The most important being FMinvoice_item0001tri_product_id

Steven