Jump to content
  • 0

Resize TextBox


Heather

Question

2 answers to this question

Recommended Posts

  • 0

Hi @Heather,

Yes, it is possible to resize the textbox of an Inline Edit on a Tabular DataPage. In order to do that, follow the steps below.

Go to the "Configure Results page" screen of your DataPage, add a header & Footer element, select the "Header", click the "Source" button and copy paste the below style

<style>
input[name="InlineAddFIELDNAME"] {width: 20px !important;}
input[name="InlineAddFIELDNAME"] {width: 30px !important;}
</style>

For Inline Edit:

<style>
input[name="InlineEditFIELDNAME"] {width: 20px !important;}
input[name="InlineEditFIELDNAME"] {width: 30px !important;}
</style>

Replace FIELDNAME with your field name.

 

Hope this helps.

 

Regards,

Kristina 

Link to comment
Share on other sites

  • 0

Hi,

 

Just adding a bit of modification to @kristina's answer.

 

With the advent of AJAX-enabled DataPages (Caspio r14), this CSS rule might not work if that feature is enabled due to the appended id  text on the elements.

In that case, you may use the updated snippet below then modify it after paste:

<style>
  input[id*="InlineAddFIELDNAME"] {width: 20px !important;}
  input[id*="InlineAddFIELDNAME"] {width: 30px !important;}
</style>

 

An easier but more sophisticated solution is to just paste this code in the FOOTER of your Results Page, then modify the field_name and target_size.

<script>

var field_name = 'created_on'; // <--Put your field name inside the quotes
var target_size = '8'; // <--Put your target size inside the quotes

  
/*Modifications are NOT necessary from this point below*/
var date_field = document.querySelector(`[action*="[@cbAppKey]"] [id*=InlineAdd${field_name}] `);
date_field.size = target_size;


</script>

 

Cheers,

DN31337

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...