Welcome to the nuBuilder Forums!

Join our community by registering and logging in.
As a member, you'll get access to exclusive forums, resources, and content available only to registered users.

Default value in subform 1st row

Post Reply
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Default value in subform 1st row

Unread post by ruiascensao »

Hi,

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

Thank you.
Best Regards,
Rui
BR
Rui
admin
Site Admin
Posts: 2825
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 29 times

Re: Default value in subform 1st row

Unread post 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
ruiascensao
Posts: 177
Joined: Tue Nov 15, 2011 2:24 pm

Re: Default value in subform 1st row

Unread post 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
BR
Rui
admin
Site Admin
Posts: 2825
Joined: Mon Jun 15, 2009 2:23 am
Been thanked: 29 times

Re: Default value in subform 1st row

Unread post 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
Post Reply