Ray Phelan
Posts: 0
Joined: Fri Apr 18, 2014 3:59 pm

setting CSS height of textbox with javascript

Hi.

I am trying to set the height of a 'textbox' with javascript, but nothing happens:

I've tried this on "Page Load" and "Page Show".... but not working...
Appery('message').css('height','150px');

Why will this not work?

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

setting CSS height of textbox with javascript

Hi Ray,

Please try:
preApperyio('message').css('height','150px');/pre

Ray Phelan
Posts: 0
Joined: Fri Apr 18, 2014 3:59 pm

setting CSS height of textbox with javascript

No. This also doesnt work...
frustrating... :(

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

setting CSS height of textbox with javascript

Ray,

Are there any console errors?
Is your textarea named "message"?
Could you please try running this code on button click, for example?

Ray Phelan
Posts: 0
Joined: Fri Apr 18, 2014 3:59 pm

setting CSS height of textbox with javascript

Hi.

Yes the textarea is named "message".
I have tried it "onclick" and it works. It just doesnt work on "Load" or "Page Show" and I need it to.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

setting CSS height of textbox with javascript

Ray,

Could you please try running this code on "Load" and "Page Show"?
prealert("sometext");/pre

Ray Phelan
Posts: 0
Joined: Fri Apr 18, 2014 3:59 pm

setting CSS height of textbox with javascript

ok. tried it.
On "Load" I got the alert just before the screen was displayed.
On "Page Show" I got the alert just after the screen was displayed.
So the events are working.
But I cant change the css with these events.

Kateryna Grynko
Posts: 0
Joined: Thu Nov 15, 2012 9:13 am

setting CSS height of textbox with javascript

Ray,

Did you try doing the same on another page?

Ray Phelan
Posts: 0
Joined: Fri Apr 18, 2014 3:59 pm

setting CSS height of textbox with javascript

I've tried it on a new app.
I've put this code on "Page Show"

Apperyio('message').css('height','300px');

It seems to apply the CSS, but then it seems to do some other automatic function after "Page Show" which puts the textarea back to its default stage.

Here is the app with the textarea.
http://appery.io/app/mobile-frame?src...

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

setting CSS height of textbox with javascript

Hello!

Please try the following code:
preApperyio("message").attr('style', 'height: 150px !important');/pre

Return to “Issues”