Page 1 of 1

Set value/text for jquery input of type time

Posted: Thu Jul 09, 2015 5:19 pm
by Chris N

I have an input component which is set as type time. The text is defaulted to empty, and the placeholder is "00:00:00 AM/PM". I want to set this value to the current time. I've tried using what I believe is the appery code method, as well as jquery directly, but the values don't seem to update on the screen. Examples:

jQuery:
code$("screenName_inp_time_sent").val( "18:01:07" );/code

Appery:
codeApperyio('inp_time_sent').text("18:01:07");/code

After making the text change I've also tried running Apperyio.refreshScreenFormElements(), but it still doesn't update the user interface with the updated value. Should I be using some other method to update the input time control?


Set value/text for jquery input of type time

Posted: Fri Jul 10, 2015 5:36 am
by Pavel Zarudniy

Set value/text for jquery input of type time

Posted: Fri Jul 10, 2015 4:28 pm
by Chris N

So to clarify from your link, I should be using:
codeApperyio('inp_time_sent').text("18:01:07");/code

What would be the appropriate code if I was to use jQuery instead?


Set value/text for jquery input of type time

Posted: Mon Jul 13, 2015 1:43 am
by Yurii Orishchuk

Hi Chris,

You can use following JS code to get current value from input component:

pre

var value = Apperyio("mobiletextinput_93").val();
console.log("value = " + value);

/pre

And here is is code to set value:

pre

Apperyio("mobiletextinput_93").val("04:06")

/pre

Regards.