Page 1 of 1

Adjust max-width of the "fieldcontain" of in Input Component

Posted: Mon Jul 07, 2014 6:01 am
by Matthew Pickard

What is the easiest way to adjust max-width of the "fieldcontain" of in Input Component. Ive tried the following in "Run JavaScript" on a page load.:

Appery('userNameInput').css("max-width","300px");

but it's not working with the "fieldcontain" just where the user can input text. Any ideas?


Adjust max-width of the "fieldcontain" of in Input Component

Posted: Mon Jul 07, 2014 7:16 am
by Kateryna Grynko

Hi Matthew,

Use the following code please:preApperyio('userNameInput').parents().find("data-role=fieldcontain").css("max-width","300px");/pre


Adjust max-width of the "fieldcontain" of in Input Component

Posted: Tue Jul 08, 2014 2:10 am
by Matthew Pickard

This is the error I get in the console:

"Uncaught Error: Syntax error, unrecognized expression: data-role=fieldcontain"


Adjust max-width of the "fieldcontain" of in Input Component

Posted: Tue Jul 08, 2014 12:07 pm
by Kateryna Grynko

Hi Matthew,

I'm sorry, mistyped :(
Should be the following:preApperyio('userNameInput').parents().find("[data-role=fieldcontain]").css("max-width","300px");/pre


Adjust max-width of the "fieldcontain" of in Input Component

Posted: Tue Jul 08, 2014 4:40 pm
by Matthew Pickard

Perfect, now just to get it to always be center I tried:

Apperyio('userNameInput').parents().find("[data-role=fieldcontain]").css("align","center");

but that is not working. I even tried the simplified version:

Appery('userNameInput').css("align","center");


Adjust max-width of the "fieldcontain" of in Input Component

Posted: Wed Jul 09, 2014 2:03 am
by Yurii Orishchuk

Hi Matthew,

Please use following code:

pre

//Note you should replace 'mobiletextinput_42' with your input component name.
Apperyio('mobiletextinput_42').parents().find("[data-role=fieldcontain]").css({
"max-width": "300px",
"margin-left": "auto",
"margin-right": "auto"
});

/pre

Regards.