•  

How to limit the characters in Title and Description and etc.....

This thread is over 4 months old
The content and issues discussed here maybe out of date or inaccurate.

Check you are running the latest version of your PremiumPress theme then look for a more recent forum post or submit a support ticket.
  1. u 3583
    offline
    Fernando
    Posted 1 year ago

    I am using Classified Theme and I want to limit the Title to 100 characters, Search Description to 140 characters, main description to 6000 characters and I want to add the characters counter to show the user how many characters he/she has available as in twitter

    How do I do that ?

    Thanks for all help

  2. u 5540
    offline
    Mikeavailable for hire
    Posted 1 year ago

    Looking to do the same....anyone got any advice?

  3. u 6
    offline
    Alex
    Posted 1 year ago

    Hi,
    You mean on the submit page right?

  4. u 3583
    offline
    Fernando
    Posted 1 year ago

    Yes, in the submit page. When a user is submitting a new classified add

  5. u 6049
    offline
    Robert
    Posted 1 year ago

    Hi Fernando,

    This might help answer your question: http://www.cs.tut.fi/~jkorpela/forms/textarea.html Scroll all the way to the bottom where you see "Real-time" JavaScript check.

  6. u 3583
    offline
    Fernando
    Posted 1 year ago

    That is exactly what I need LOL but I am completely newbie on PHP. I got a few TIPS from this post http://www.premiumpress.com/forums/topic/character-limit-for-description-search
    But only for description and I would like for everything without messing with the Code.

    But Thanks Robert

  7. u 5519
    offline
    Bill
    Posted 1 year ago

    Sorry Fernando. there is no any feature to do it in the PP themes, and I can't fine any outside plugin for doing it, So you need to messing with the Code, and it's FUN!

    Bill.

  8. u 3583
    offline
    Fernando
    Posted 1 year ago

    I added this code in DIV for Description, just need to know if I can do the same to Title and Description...?

    <textarea tabindex="3" class="long" rows="4" name="form[short]" id="short1" maxlength="10"><?php if(isset($_POST['action']) && !isset($data) ){ echo $_POST['form']['short']; }elseif(isset($data)){ echo $data['post_excerpt']; } ?></textarea>

    Regards
    Fernando

  9. u 4
    offline
    Posted 1 year ago

    Hi Fernando,

    I use substr function to limit the number characters that you want to echo out. Check the manual here http://php.net/manual/en/function.substr.php

    Thanks for contacting Premiumpress,

  10. u 3583
    offline
    Fernando
    Posted 1 year ago

    Thanks Dave, but it is to much php for a newbie like me, just fix it adding a small code to each line.

    Thanks

  11. u 4
    offline
    Posted 1 year ago

    Can you tell me which exactly are you wanting to limit the characters so can give you the code.

    Thanks,

  12. u 3583
    offline
    Fernando
    Posted 1 year ago

    I sorted out. When a User is adding a new list he/she has to add a
    Title:
    Search Description:
    Main Description:

    I want to limit the characters on each one, so title will be at max 140 characters, Search Description max 140 characters and Main Description with 1500 characters, otherwise my users can add how many as they want...

    So to avoid this I just add to _tpl_add.php to each line that I want to change of a maxlength="***"

    *** can be 140, 1500 whatever I want

    right ?

  13. u 6
    offline
    Alex
    Posted 1 year ago

    Great, thanks for sharing.

  14. u 1296
    offline
    Ruslan
    Posted 1 year ago

    I'm cunfused. Its doesnt work for me. Still posters available to post large amount of text in short description

    I used this :

    <div class="full clearfix border_t box">
    <p>
    <label for="comment"><?php echo SPEC($GLOBALS['_LANG']['_tpl_add12']) ?><span class="required">*</span></label>

    <textarea tabindex="3" class="long" rows="2" name="form[short]" id="short1" maxlength="10"><?php if(isset($_POST['action']) && !isset($data) ){ echo $_POST['form']['short']; }elseif(isset($data)){ echo $data['post_excerpt']; } ?></textarea>

    <small><?php echo SPEC($GLOBALS['_LANG']['_tpl_add13']) ?></small>
    </p>
    </div>

    Maybe I do smth wrong ? pls help

  15. u 286
    offline
    Les
    Posted 1 year ago

    Thanks Mark.
    This works beautiful to me!
    Les

  16. u 5519
    offline
    Bill
    Posted 1 year ago

    Thanks for update Les,

    Bill.