cancel
Showing results for 
Search instead for 
Did you mean: 

Changing the Length of the Input field in HWA

Former Member
0 Kudos

Hello All,

We are using SUP 2.2

I have a requirement where i need to change the length of the input field to 10. In the generated .html file the size="x" property is not there , but when i try to add this in the file and deploy the code without regenerate the code, it is not taking effect and the input field size is still lengthy.

I have added the code in the workflow_jQueryMobileLookAndFeel.html file and checked it. Is this the right file to set the input field length. What other place/ways i can set the size of the input field.

<div class="editbox">

   

          <label class="left" for="Document_Type">Document Type </label>

            <input class="right" type="text" id="Document_Type" sup_html_type="text"  sup_max_length="32767" size="10" sup_num_of_decimals="0"/><span id="Input_Details_Document_Type_help" class="help"></span>

          </div>

 

          <div class="editbox">

   

          <label class="left" for="Sales_Organisation">Sales Organisation </label>

            <input class="right" type="text" id="Sales_Organisation" sup_html_type="text"  sup_max_length="32767" size="10" sup_num_of_decimals="0"/><span id="Input_Details_Sales_Organisation_help" class="help"></span>

          </div>

 

I have added size="10" in the html file as above and tried to deploy that file without generating the code (As the code generation will overwrite my changes).

Please let me know where i need to make the changes to change the size of the input field in Hybrid Web Container.

Is it possible to change it in custom.js file and where i have to put the code and what will be correct code to update the input field size.

Thanks & Regards,

Neeraj       

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I believe what you want is to set the maxlength attribute (not size).  E.g. maxlength="10".  You may also consider doing this with JavaScript in Custom.js (which doesn't get overwritten).  As you've noted, editing the workflow_jQueryMobileLookAndFeel.html will lose your changes if you regenerate the app.

Thanks,

Andrew.

Former Member
0 Kudos

Hi Andrew,

Thanks for your reply. Actually i want to set the size only as the size of the text box looks to be longer than expected .the maxlength will restrict the number of characters to be keyed in by the user.

Can you throw me some light on how this can be possible for the Input field in the Custom.js file.

Thanks.

Former Member
0 Kudos

Hi, can you clarify what you mean?  Are you saying you wish to change the default width of the editbox?  If so, you may wish to look at editBox.css although the default is typically to stretch to the edge of the screen which works ok for most screens.

Thanks,

Andrew.

Former Member
0 Kudos

Hi Andrew,

Yes. I would like to change the default width of the edit box. There is no editBox.css for the iPhone and Android and available for BB only. From the Screen Design of the Edit Box, It looks its not possible to change its size.

I have tried the below JQuery methods in the BeforeShowScreen and AfterShowScreen but did not get the size of the edit box changed.

$("#Name").attr("size","5"); // (Set the size attribute to 5 by using the id of the edit box.

This works fine when i try with a sample html form in the desktop with jquery method.

It looks edit box is  rendered based on the screen width/height of the device, and there is no provision to change the size.

Thanks

Answers (0)