Viewing 15 replies - 1 through 15 (of 17 total)
  • Hi stevesien try the following maxlength=”200″ to the attributes field and it will change the max length. Remember to change the number 200 to what ever suits your need.

    Thread Starter stevesien

    (@stevesien)

    it doesn’t work. I want a 4 character wide text box. I can set maxlength so you can only enter 4 characters but the box itself is much wider.
    I am talking about the settings in the Details section for a text field. Max length is 4 then there is the attributes:__________

    I want the box itself to be 4 characters wide for inputting a quantity which will not exceed 4 characters ie. 9999

    Sorry for misunderstanding your question. In that case your best option is to add a Regex Validation expression.

    Thread Starter stevesien

    (@stevesien)

    Regex validation? I still don’T think you understand my question. I want the box to be 4 characters wide.

    Yes you are correct. The only way to create a field that only allows a max of 4 characters like 1234 is by adding maxlength=”5″ but in the HTML tag and not as CSS style. I am not sure how you can achieve this through the settings.

    Hi I just did some more testing. This is what I found so far. If the field you are referring too is one of the default Text fields it will not work when you enter a value in the Max length: field under Fields tab.

    If you add a new field for example a text field and you enter a value in the Max length: field it will work.

    Thread Starter stevesien

    (@stevesien)

    i added a new text field and added maxlength=”4″ in attributes but the box is still 200 or so

    Hi stevesien can you add the value to the Max Length: and not the Attributes.

    Thank you

    Thread Starter stevesien

    (@stevesien)

    I did that too, the box is stil ltoo long but i can only input 4 numbers.

    Okay try the following max-width=50px

    Thread Starter stevesien

    (@stevesien)

    no I did that it didn’t work . I can see in the web inspector on Safari that this is controlling the width input#fscf_field1_4 text-align: left;
    margin: 0;
    width: 99%;
    max-width: 250px;
    if I change this value it controls the width of the box.
    thanks

    I have run out of ideas sorry. I have submitted a message to Mike Challis the plugin author.

    Regards

    Thread Starter stevesien

    (@stevesien)

    thanks

    The problem is CSS is higher priority than the size= and maxlength= HTML settings

    So you have to use custom css setting for the field, then put some css in it like this: max-width: 30px;
    Adjust the number as needed.

    If you want to force users to only enter a range of numbers 0-9999 you have to use the regex settings for the field, something like
    /^\d{1,4}$/

    Also be sure to enter a regex fail message.

    Mike

    So custom CSS in style sheet — what is the full code, please?

    I’ve tried using the samples provided 4 years ago on your site but to no avail. How to I change “fscf_field2_9” so that the input field (not value entered) is 5?

    thanks.

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘length of text box attribute not working’ is closed to new replies.