How can i stop people using caps in the title ?
Maybe even in the listing description if all are caps it shouldnt be posted.
How can i stop people using caps in the title ?
Maybe even in the listing description if all are caps it shouldnt be posted.
Yeah its frustrating when people either use all capitals or none at all.
There is a text-transform property for css but i think that either turns all letters to capitals or lowercase,
text-transform:uppercase; (turns text to capitals)
text-transform:capitalize; (turns first letter of each word to capital, but i think if someone typed all capitals it will stay as all capitals)
text-transform:lowercase; (turns test to lowercase)
To add error message and disallow to post it you can do following:
open includes/rlCommon.inc.php
find function checkDynamicForm
Find case "text": there and at the bottom of the "case"
just before
Code:Only registered members can view the code.
add code
it will show error for the field when they are only uppercase symbols.Code:Only registered members can view the code.
Error will say "the field is incorrect"
To play with error message please change $GLOBALS['lang']['notice_field_incorrect']
to notice_field_uppercase for example
then through the languages manager add appropriate error message with key notice_field_uppercase and {field} inside the phrase body, it will be replaced with actual field name.
It's just for text field, you can do the same for textarea field in the same function.
Let me know if it's not clear or it's not working right.
Gonna try it later today.
Thanks
Thanks! This works great, except for one problem.
When I add this to /includes/classes/rlCommon.class.php if one of the non-required text fields is empty (no text entered), it triggers notice_field_uppercase
strtoupper(empty) matches empty.
It works great if ALLCAPS is entered to show notice_field_uppercase, but how do I not trigger notice_field_uppercase if the field is simply empty?
Last edited by Horizon; January 3, 2024 at 09:03 AM.
Also would there be an option if ALLCAPS is detected in a text field to simply rewrite the field to lowercase?
You need to make your text filed "required" to trigger an error that it's empty
to automatically transform text to lowercase (with the first capital letter) instead of the code below use this:
PHP Code:
Only registered members can view the code.
I don't necessarily want to make all text fields required though, as I have many optional ones.
I suspect I need to wrap the above with an if not empty php statement ? but don't want to make a mistake.
[QUOTE=Rudi;38610]You need to make your text filed "required" to trigger an error that it's empty
to automatically transform text to lowercase (with the first capital letter) instead of the code below use this:
/QUOTE]PHP Code:
Only registered members can view the code.
Thanks, this actually might be better. Instead of nagging users who enter ALLCAPS, I'll just convert it if entered ALLCAPS to Allgood
Hmmm, this doesn't seem to do anything
When adding or editing a listing, My ALLCAPS TEXT in either textarea or text remains ALLCAPS. What am I missing?Code:Only registered members can view the code.
Last edited by Horizon; January 3, 2024 at 09:46 AM.