Page 1 of 2
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 11:41 am
by Ray Phelan
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?
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 11:52 am
by Kateryna Grynko
Hi Ray,
Please try:
preApperyio('message').css('height','150px');/pre
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 11:56 am
by Ray Phelan
No. This also doesnt work...
frustrating... 
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 2:06 pm
by Kateryna Grynko
Ray,
Are there any console errors?
Is your textarea named "message"?
Could you please try running this code on button click, for example?
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 3:07 pm
by Ray Phelan
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.
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 3:20 pm
by Kateryna Grynko
Ray,
Could you please try running this code on "Load" and "Page Show"?
prealert("sometext");/pre
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 3:27 pm
by Ray Phelan
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.
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 3:45 pm
by Kateryna Grynko
Ray,
Did you try doing the same on another page?
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 3:59 pm
by Ray Phelan
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...
setting CSS height of textbox with javascript
Posted: Mon Apr 28, 2014 5:04 pm
by Maryna Brodina
Hello!
Please try the following code:
preApperyio("message").attr('style', 'height: 150px !important');/pre