By misty3 on
HOW TO AVOID BLANK SUBJECT FIELD WHEN TAB OR SPACE BAR IS HIT A FEW TIMES ?
Where in the code is the 'name' or 'subject or 'title' field validated - can someone kindly point to this ?
Best regards
HOW TO AVOID BLANK SUBJECT FIELD WHEN TAB OR SPACE BAR IS HIT A FEW TIMES ?
Where in the code is the 'name' or 'subject or 'title' field validated - can someone kindly point to this ?
Best regards
Comments
Any help or link on this,
Any help or link on this, please ?
Best regards
hmmm
Interesting, the core validation for required fields doesn't apply the trim() function...
Here's the relevant function:
http://api.drupal.org/api/4.7/function/_form_validate
One easy fix: a custom validation mini module (see for general instructions: http://drupal.org/node/70903). Save as misty3_emergency.module (note: this is only very briefly tested, but should be easy to get working).
This will prevent node title from being just whitespace.
---
Work: BioRAFT
patch for node module
see: http://drupal.org/node/113705
---
Work: BioRAFT
Thanks a zillion. This is
Thanks a zillion.
This is just to say a quick thanks.
The 'trim' was in my mind but had no idea how and where to apply .............
I was trying in approx line 234 of includes/form.inc
where it is
if ($elements['#required'] && empty($elements['#value']) && $elements['#value'] !== '0')I was guessing that trim has to go somewhere here ( and possibly it ?can ).... but had no success.
I will just try out your solution but want to say again, 'thanks'
Best regards
The patch works GREAT
Hi Peter Wolanin,
I have applied the patch and it works fine.
In fact I find that this can be used with some more addition
to define the min and max words needed by the admin for
the title/subject field.
I was also looking for some option which can define the max allowable size in kbs for a gif /jpg.
[[ BTW , this is absolutley unrelated but since you have the gift of an excellent coder in you will it be possible
to take a look at this http://drupal.org/node/107201, which after many posts and tries , looks very weird without any solution ]]
So once again, a zillion thanks.
Best regards