CodeCharge Studio
search Register Login  

Web Reporting

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

YesSoftware Forums -> CodeCharge Studio -> IDE/GUI

 Dynamically change control type at run time?

Print topic Send  topic

Author Message
Suntower

Posts: 225
Posted: 11/14/2006, 3:23 PM

I was wondering if, in ASP or JS there was a way to change the type of input control the user will see when an update window opens---based on the control.

IOW: If the control for the data source is an int, the control would have a numeric picture. If it were S50 it would be a common text box. If it were something like a 'memo', it would have a TEXTAREA.

Any thoughts on how to do this? My first idea was to have 4 controls and hide/unhide them in the BeforeShow event. I'm certain there is something more clever than that, right? :-D

TIA,

---JC

PS: I gotta say.... 3.1 is a -really- good update. WELL DONE!
_________________
---On a campaign for more examples and better docs!
View profile  Send private message
Edd


Posts: 547
Posted: 11/15/2006, 10:15 PM

Suntower,
I know what you are trying to do but is it worth the hassle?
K.I.S.S.

Alternative 1:
I suggest an alternative (But not really pretty) - Use JS to resize a textArea from 1 to 5 rows - realtively easy to use and then add script so they can't type in more than x characters and eliminating Carriage Returns / Line Feeds. You probably will end up with JS code than you want in this one.

Alternative 2:
Make your update field hidden.
Add both a TextArea and a Textbox field on the form Have the populated from the before showevent from the hiden field
Add an onChange event to both to write their values to the hidden field.
Add Javascript to Hide / Show the TextArea or Textbox depending upon the option selected.


Edd

_________________
Accepting and instigating change are life's challenges.

http://www.syntech.com.au
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.