jQuery UI Widgets › Forums › General Discussions › Standard HTML Input
Tagged: Input
This topic contains 4 replies, has 2 voices, and was last updated by gasetr 13 years, 7 months ago.
-
AuthorStandard HTML Input Posts
-
I’m trying to set the width for a standard HTML input, but for some reason jqWidgets ignores the “style: 200px;” declaraction.
To get around this I’ve used the following code which seems to work well:
$(“#Username”).jqxButton({
width: 200,
theme: “”
});But I’m wondering if there is a better way to achieve the same result?
Hi gasetr,
Each widget has ‘width’ and ‘height’ properties. When the widget is initialized, its HTML element’s width and height are set to the ‘width’ and ‘height’ properties. That’s the reason why the HTML settings are ignored.
Best Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comI thought something might be going on in the background.
So is my idea of using jqxButton with no theme as indicated above a suitable way of controlling the width of an HTML input, or should I be doing this using some other method?
The reason I ask is because there are jqxMaskedInput and jqxNumberInput widgets, but no simple jqxInput widget.
Hi gasetr,
If you are creating a button widget, the way to set its width or height is to set its width or height properties.
As we don’t have a basic TextBox widget, you can use the HTML Input Tag and initialize it as a standard HTML element.
The following code initializes an Input Tag with Width set to 200px.
<input style="width: 200px;" />Bets Regards,
Peter StoevjQWidgets Team
http://www.jqwidgets.comHi Peter,
As I mentioned above, I was not able to set the width using the style, so I cheated a little by applying the jqxButton attribute to my input field.
It works and it allows me to use other settings (such as disable) with the input, just as I would do with a button. I’m happy the results, but I’d like confirmation on whether or not this is a good practice.
Also, is there any thought of adding a simple jqInput to the library, so Input Tags can be handled like any other widget?
-
AuthorPosts
You must be logged in to reply to this topic.