Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to change the "id" tag of an input without changing source code

Hi,

I am using mobiscroll datetimepicker widget. First of all, I have to insert an input widget in the screen:

input name="demo" id="demo" class="i-txt"

After, I put the following Javascript code in the Load screen event (my screen is named "screen1":

$('#demo').mobiscroll().datetime({
minDate: new Date(now.getFullYear(), now.getMonth(), now.getDate()),
theme: 'ios',
display: 'bottom',
mode: 'scroller'
});

When I run the application, the datetime picker is not loaded when I click the "demo" input. But, when I go to the source code, and change the input id from "screen1_demo" (generated by app builder) to "demo" it works properly. But, of course, I don't want to change the source code because it may be done only in the end of development. The question is: is there another way of changing input id without changing the source code (that is, I want the same "name" and "id") ?

Thank you very much.

Alena Prykhodko
Posts: 0
Joined: Tue Apr 09, 2013 7:36 am

How to change the "id" tag of an input without changing source code

Hello!

Where do you set up input id ="demo"?

Pasteur Miranda
Posts: 0
Joined: Thu Aug 01, 2013 2:59 am

How to change the "id" tag of an input without changing source code

Hi Alena,

The id tag is automatically set up by app builder. I set the name of the input as "demo" and the app builder set its id up as "screen1_demo". I would like to know if it's possible to set the input id manually,instead of changing it in source code (that is, the solution i've found).

Code: Select all

Thank you very much.
Igor
Posts: 0
Joined: Tue Apr 02, 2013 12:05 pm

How to change the "id" tag of an input without changing source code

Hello,

Please try to use next code to change component id

pre
code
Appery('mobiletextinput_57').attr("id","demo");
/code
/pre

Replace 'mobiletextinput_57' with yours input component name.

Return to “Issues”