The CreatorCon Call for Content is officially open! Get started here.

Get value of decimal field w/ client script

JJG
Kilo Guru

Hello,

I have a decimal field on a form. I have a client-side UI action that needs to display the decimal field value on a confirmation pop up. So far I am not getting the expected result. What am I missing?

var number =  parseFloat(g_form.getValue('hours_worked_today')); //This is the decimal field

var answer = confirm('Please Confirm That You Want to Submit ' + number + ' Hours For ' + g_form.getValue('date'));
     if (answer == true) {
     gsftSubmit(null, g_form.getFormElement(), "hourInput");
}

RESULT

find_real_file.png

 

1 ACCEPTED SOLUTION

vkachineni
Kilo Sage

try

getDecimalValue(String fieldName)

 

var number = parseFloat(g_form.getDecimalValue('hours_worked_today')); //This is the decimal fiel

Please mark Correct and click the Thumb up if my answer helps you resolve your issue. Thanks!
Vinod Kumar Kachineni
Community Rising Star 2022

View solution in original post

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Hi,

 

I guess since you use parseFloat() the field 'Hours worked' should be an integer field & not string.

 

Thanks,

Jaspal Singh

Its a decimal field.

Mike Patel
Tera Sage

try changing parseFloat to parseInt

JJG
Kilo Guru

Any Ideas?