Specifying minimum number of WORDS for text field

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Specifying minimum number of WORDS for text field

Al Johnson
Hi,

I have another unusual request /^)  I need to specify NOT the minimum length of a text field, but the minimum number of WORDS.  How might I go about doing that?

Thanks!
Al
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Specifying minimum number of WORDS for text field

Yaron Koren-2
Hi Al,

You should be able to do that using the "regexp" input type defined in
Semantic Forms Inputs, and some sort of clever regular expression.

-Yaron

On Thu, Mar 7, 2013 at 11:17 PM, Al Johnson <[hidden email]> wrote:

> Hi,
>
> I have another unusual request /^)  I need to specify NOT the minimum
> length of a text field, but the minimum number of WORDS.  How might I go
> about doing that?
>
> Thanks!
> Al
>
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>



--
WikiWorks · MediaWiki Consulting · http://wikiworks.com
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Specifying minimum number of WORDS for text field

Al Johnson
Thanks Yaron.  But, I tried that and cannot seem to get Regular Expression Filter to work at all.  I've got SemanticBundle 1.8 alpha with Semantic Forms Inputs 0.7 alpha and verified that it is in stalled via the Version page.

None of these simple snippets work with the input string "a b" where the match is for a single 'x' character:

{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory|base type=textarea}}}
{{{field|My Property|input type=regexp|regexp=/^x$/|mandatory|base type=textarea}}}
{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory}}}
{{{field|My Property|input type=regexp|regexp=/^x$/m}}}
{{{field|My Property|input type=regexp|regexp=/^[a-zA-Z]$/m}}} for input string '1'


No errors or anything.


What could be the problem?

Thanks,
al



________________________________
 From: Yaron Koren <[hidden email]>
To: Al Johnson <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Sent: Friday, March 8, 2013 6:33 AM
Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
 

Hi Al,

You should be able to do that using the "regexp" input type defined in Semantic Forms Inputs, and some sort of clever regular expression.

-Yaron


On Thu, Mar 7, 2013 at 11:17 PM, Al Johnson <[hidden email]> wrote:

Hi,

>
>I have another unusual request /^)  I need to specify NOT the minimum length of a text field, but the minimum number of WORDS.  How might I go about doing that?
>
>Thanks!
>Al
>------------------------------------------------------------------------------
>Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>endpoint security space. For insight on selecting the right partner to
>tackle endpoint security challenges, access the full report.
>http://p.sf.net/sfu/symantec-dev2dev
>_______________________________________________
>Semediawiki-user mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


--
WikiWorks · MediaWiki Consulting · http://wikiworks.com 
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Specifying minimum number of WORDS for text field

thingles
An alternative approach that I use a lot for situations like this is to put the check in the Template instead of the Form, and then flag the page in a category and display a warning in the template that there is a data problem.

Here is an example I put together of how I would do this. I would likely also flag them in a category that would indicate maintenance work.

http://mediawikicookbook.com/wiki/Wordcount

Maybe this will work for you.
Jamie Thingelstad
[hidden email]
mobile: 612-810-3699
find me on AIM Twitter Facebook LinkedIn

On Mar 8, 2013, at 6:32 PM, Al Johnson <[hidden email]> wrote:

> Thanks Yaron.  But, I tried that and cannot seem to get Regular Expression Filter to work at all.  I've got SemanticBundle 1.8 alpha with Semantic Forms Inputs 0.7 alpha and verified that it is in stalled via the Version page.
>
> None of these simple snippets work with the input string "a b" where the match is for a single 'x' character:
>
> {{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory|base type=textarea}}}
> {{{field|My Property|input type=regexp|regexp=/^x$/|mandatory|base type=textarea}}}
> {{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory}}}
> {{{field|My Property|input type=regexp|regexp=/^x$/m}}}
> {{{field|My Property|input type=regexp|regexp=/^[a-zA-Z]$/m}}} for input string '1'
>
>
> No errors or anything.
>
>
> What could be the problem?
>
> Thanks,
> al
>
>
>
> ________________________________
> From: Yaron Koren <[hidden email]>
> To: Al Johnson <[hidden email]>
> Cc: "[hidden email]" <[hidden email]>
> Sent: Friday, March 8, 2013 6:33 AM
> Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
>
>
> Hi Al,
>
> You should be able to do that using the "regexp" input type defined in Semantic Forms Inputs, and some sort of clever regular expression.
>
> -Yaron
>
>
> On Thu, Mar 7, 2013 at 11:17 PM, Al Johnson <[hidden email]> wrote:
>
> Hi,
>>
>> I have another unusual request /^)  I need to specify NOT the minimum length of a text field, but the minimum number of WORDS.  How might I go about doing that?
>>
>> Thanks!
>> Al
>> ------------------------------------------------------------------------------
>> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>> endpoint security space. For insight on selecting the right partner to
>> tackle endpoint security challenges, access the full report.
>> http://p.sf.net/sfu/symantec-dev2dev
>> _______________________________________________
>> Semediawiki-user mailing list
>> [hidden email]
>> https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>
>
> --
> WikiWorks · MediaWiki Consulting · http://wikiworks.com 
> ------------------------------------------------------------------------------
> Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
> Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
> endpoint security space. For insight on selecting the right partner to
> tackle endpoint security challenges, access the full report.
> http://p.sf.net/sfu/symantec-dev2dev
> _______________________________________________
> Semediawiki-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/semediawiki-user

------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Specifying minimum number of WORDS for text field

Al Johnson
That's a great backup plan. Thanks much. al




________________________________
 From: Jamie Thingelstad <[hidden email]>
To: Al Johnson <[hidden email]>
Cc: Yaron Koren <[hidden email]>; "[hidden email]" <[hidden email]>
Sent: Saturday, March 9, 2013 7:56 AM
Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
 

An alternative approach that I use a lot for situations like this is to put the check in the Template instead of the Form, and then flag the page in a category and display a warning in the template that there is a data problem. 

Here is an example I put together of how I would do this. I would likely also flag them in a category that would indicate maintenance work.

http://mediawikicookbook.com/wiki/Wordcount

Maybe this will work for you.

Jamie Thingelstad
[hidden email]
mobile: 612-810-3699
find me on AIM Twitter Facebook LinkedIn

On Mar 8, 2013, at 6:32 PM, Al Johnson <[hidden email]> wrote:

Thanks Yaron.  But, I tried that and cannot seem to get Regular Expression Filter to work at all.  I've got SemanticBundle 1.8 alpha with Semantic Forms Inputs 0.7 alpha and verified that it is in stalled via the Version page.

>
>None of these simple snippets work with the input string "a b" where the match is for a single 'x' character:
>
>{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory|base type=textarea}}}
>{{{field|My Property|input type=regexp|regexp=/^x$/|mandatory|base type=textarea}}}
>{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory}}}
>{{{field|My Property|input type=regexp|regexp=/^x$/m}}}
>{{{field|My Property|input type=regexp|regexp=/^[a-zA-Z]$/m}}} for input string '1'
>
>
>No errors or anything.
>
>
>What could be the problem?
>
>Thanks,
>al
>
>
>
>________________________________
>From: Yaron Koren <[hidden email]>
>To: Al Johnson <[hidden email]>
>Cc: "[hidden email]" <[hidden email]>
>Sent: Friday, March 8, 2013 6:33 AM
>Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
>
>
>Hi Al,
>
>You should be able to do that using the "regexp" input type defined in Semantic Forms Inputs, and some sort of clever regular expression.
>
>-Yaron
>
>
>On Thu, Mar 7, 2013 at 11:17 PM, Al Johnson <[hidden email]> wrote:
>
>Hi,
>
>
>>I have another unusual request /^)  I need to specify NOT the minimum length of a text field, but the minimum number of WORDS.  How might I go about doing that?
>>
>>Thanks!
>>Al
>>------------------------------------------------------------------------------
>>Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>>Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>>endpoint security space. For insight on selecting the right partner to
>>tackle endpoint security challenges, access the full report.
>>http://p.sf.net/sfu/symantec-dev2dev
>>_______________________________________________
>>Semediawiki-user mailing list
>>[hidden email]
>>https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>>
>>
>
>--
>WikiWorks · MediaWiki Consulting · http://wikiworks.com 
>------------------------------------------------------------------------------
>Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
>Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
>endpoint security space. For insight on selecting the right partner to
>tackle endpoint security challenges, access the full report.
>http://p.sf.net/sfu/symantec-dev2dev
>_______________________________________________
>Semediawiki-user mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user
Reply | Threaded
Open this post in threaded view
|

Re: Specifying minimum number of WORDS for text field

Al Johnson
In reply to this post by Al Johnson
I got this to work.  It seems like the 'm' for multiline matching was causing a problem, unless I was using it wrong.




________________________________
 From: Al Johnson <[hidden email]>
To: Yaron Koren <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Sent: Friday, March 8, 2013 5:32 PM
Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
 

Thanks Yaron.  But, I tried that and cannot seem to get Regular Expression Filter to work at all.  I've got SemanticBundle 1.8 alpha with Semantic Forms Inputs 0.7 alpha and verified that it is in stalled via the Version page.

None of these simple snippets work with the input string "a b" where the match is for a single 'x' character:

{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory|base type=textarea}}}
{{{field|My Property|input type=regexp|regexp=/^x$/|mandatory|base type=textarea}}}
{{{field|My Property|input type=regexp|regexp=/^x$/m|mandatory}}}
{{{field|My Property|input type=regexp|regexp=/^x$/m}}}
{{{field|My Property|input type=regexp|regexp=/^[a-zA-Z]$/m}}} for input string '1'


No errors or anything.


What could be the problem?

Thanks,
al



________________________________
 From: Yaron Koren <[hidden email]>
To: Al Johnson <[hidden email]>
Cc: "[hidden email]" <[hidden email]>
Sent: Friday, March 8, 2013 6:33 AM
Subject: Re: [Semediawiki-user] Specifying minimum number of WORDS for text field
 

Hi Al,

You should be able to do that using the "regexp" input type defined in Semantic Forms Inputs, and some sort of clever regular expression.

-Yaron


On Thu, Mar 7, 2013 at 11:17 PM, Al Johnson <[hidden email]> wrote:

Hi,

>
>I have another unusual request /^)  I need to specify NOT the minimum length of a text field, but the minimum number of WORDS.  How might I go about doing that?
>
>Thanks!
>Al
>------------------------------------------------------------------------------
>Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester
>Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the
>endpoint security space. For insight on selecting the right partner to
>tackle endpoint security challenges, access the full report.
>http://p.sf.net/sfu/symantec-dev2dev
>_______________________________________________
>Semediawiki-user mailing list
>[hidden email]
>https://lists.sourceforge.net/lists/listinfo/semediawiki-user
>


--
WikiWorks · MediaWiki Consulting · http://wikiworks.com 
------------------------------------------------------------------------------
Symantec Endpoint Protection 12 positioned as A LEADER in The Forrester  
Wave(TM): Endpoint Security, Q1 2013 and "remains a good choice" in the  
endpoint security space. For insight on selecting the right partner to
tackle endpoint security challenges, access the full report.
http://p.sf.net/sfu/symantec-dev2dev
_______________________________________________
Semediawiki-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/semediawiki-user