Chris N
Posts: 0
Joined: Thu Mar 19, 2015 5:18 pm

Set value/text for jquery input of type time

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?

Chris N
Posts: 0
Joined: Thu Mar 19, 2015 5:18 pm

Set value/text for jquery input of type time

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?

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Set value/text for jquery input of type time

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.

Return to “Issues”