GMSC Discussions

GeoMedia Smart Client community discussion board is where you can create, contribute and share information and knowledge in regards to configuring as well as working with GeoMedia Smart Client. Find your answers, share your knowledge and help build a strong GeoMedia Smart Client community.
Showing results for 
Search instead for 
Do you mean 
Reply
Highlighted
New Contributor
Posts: 3
Registered: 3 weeks ago

Add action into checkbox field

Hi all

 

Is it possible to add action when user click on checkbox without involving button?

 

Sample code as below:

<FormField name="NotApplicableCheck1" label="NOT APPLICABLE (N/A) " type="checkbox" editable="true" persisted="false" action="SCRIPT[IG.confirm({message: 'Are you sure?'})]" />

 

Thanks in advance.

Highlighted
Staff
Posts: 1,064
Registered: ‎10-18-2015

Re: Add action into checkbox field

hi,

 

you can subscribe to the change event:

 

IG.vent.on('form:ready', function (form) {
	var checkbox = form.getItemById('CHECKBOXID');
	checkbox.value.subscribe(onValueChange);
});

function onValueChange() {
//do something here
}

HTH,

Stefano

Stefano Turcato
Presale Engineer
Hexagon Geospatial
Highlighted
New Contributor
Posts: 3
Registered: 3 weeks ago

Re: Add action into checkbox field

Hi,

 

It's worked! Thank you! 

 

and one more question, is it possible to make the checkbox by default tick?

Thanks in advance.