CodeCharge Studio
search Register Login  

Web Reports

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> Java

 stretch that select control on focus

Print topic Send  topic

Author Message
kevind

Posts: 251
Posted: 02/01/2005, 6:30 PM

i have a 3 select boxes on a single row of a form the width of the data for these lists causes the form to be too large to fit the screen

i'd like to accomplish through the 'onfocus' event to have the width of the control expand while it has focus and contract when it loses focus

i've tried:

onfocus="this.style.value='width: 100px' "

to begin with but it errors out or does nothing in the browser

any thoughts - I want to keep it to one line of code if possible, what would the corresponding 'lostfocus' event be for this desired effect?

thanks
Kevin
_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message
peterr


Posts: 5971
Posted: 02/01/2005, 8:09 PM

Based on JavaScript/DHTML reference at http://msdn.microsoft.com/library/default.asp?url=/work.../input_text.asp , this should work:
onfocusin="this.width=300" onfocusout="this.width=100"

(please note that Java and JavaScript aren't related and probably the General forum would be better for this topic)
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
peterr


Posts: 5971
Posted: 02/01/2005, 8:28 PM

Although I just realized that onfocusin and onfocusout may be IE-specific. Thus better events would be onfocus and onblur: http://www.porjes.com/idocs/forms/_INPUT_onFocus.html
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message
kevind

Posts: 251
Posted: 02/01/2005, 8:35 PM

thanks,
will continue searching for a solution and post one here if found
kevin
_________________
thanks
Kevin

======================
CCS 3.2.x / ASP / MS Access /mySQL / PHP / jQuery / jQuery UI / jQuery Mobile
View profile  Send private message
peterr


Posts: 5971
Posted: 02/01/2005, 9:45 PM

Is there any problem with the above solution? It worked well when I tested it.
_________________
Peter R.
YesSoftware Forums Moderator
For product support please visit http://support.yessoftware.com
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

Web Database

Join thousands of Web developers who build Web applications with minimal coding.
CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.