Text: Improved
Posted: 31 October 2006 05:31 PM   [ Ignore ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

I’m developed an extension to add validation to the text field type.  Once this extension is enabled you’ll see a drop down when your editing (or creating) a text field.  Choose from the list to validate entries against a specified regular expression.  Or if you’re feeling adventurous, switch the field type to a Drop-down List and enter a regex in the textarea like so:

v:/^[a-z]+$/i

Just note that all the regex’s have to start with a ‘v:’ followed by the expression.  Fell free to add as many php-valid modifiers as you’d like.  The above would ensure that the field is composed of all alphanumeric characters.

1.0.1 Downloads: 2
1.0.2 Downloads: 15

File Attachments
ext.text_improved_103.zip  (File Size: 4KB - Downloads: 346)
 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 31 October 2006 05:55 PM   [ Ignore ]   [ # 1 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  846
Joined  2002-02-05

Great extension Mark!

Would it be possible to honor the “Is this a required field?” setting?
Right now it’s not possible to leave a field empty.

Cheers

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 31 October 2006 06:25 PM   [ Ignore ]   [ # 2 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

I’m not sure what you mean by “required”?

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 31 October 2006 09:17 PM   [ Ignore ]   [ # 3 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

Got it cocoaholic, ext has been updated to 1.0.1 to allow empty entries.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 01 November 2006 02:43 AM   [ Ignore ]   [ # 4 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  503
Joined  2004-04-24

Mark Huot you are an extension making machine! Thanks for sharing them :D

 Signature 

lukestevensdesign.com · Design 2.0 · Pro Network member

Profile
 
 
Posted: 01 November 2006 03:19 AM   [ Ignore ]   [ # 5 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  846
Joined  2002-02-05

Thanks Mark!

What do the “settings” do for this extension?

$settings['columns'] = '2';
$settings['labels'] = array('t', "One\rTwo\rThree\r");

Did they accidentally sneak into your code, or are you working on more cool features? wink

 Signature 

Member of the EE Pro Network

Profile
 
 
Posted: 01 November 2006 08:23 AM   [ Ignore ]   [ # 6 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

You got it cocoaholic, it snuck in there from my Multi-text extension.  I’ve since removed it and added new settings so that if you define your own regular expression match you can then define your own error message in the settings page.  Enjoy, version is 1.0.2 at the top of the thread.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 21 November 2006 07:34 PM   [ Ignore ]   [ # 7 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1183
Joined  2006-01-05

version 1.0.3 fixes the alerts to use the field labels not the names.

 Signature 

================================================
    Mark Huot
    http://markhuot.com
================================================

Profile
 
 
Posted: 08 March 2007 07:39 PM   [ Ignore ]   [ # 8 ]  
Research Assistant
RankRankRank
Total Posts:  531
Joined  2005-01-05

Mark, any chance of getting this to work with standalone entry/edit forms?

 Signature 

Celebrating again soon.

Profile
 
 
Posted: 22 June 2007 06:10 PM   [ Ignore ]   [ # 9 ]  
Grad Student
Avatar
Rank
Total Posts:  61
Joined  2005-11-15

Another request to have this work with SEAFs.  It looks like the validation works, but instead of getting the user message template with the error message when and invalid field is submitted, I get a blank screen.  I would love to be able to use this extension on a current project. smile

 Signature 

Andrea Schwandt-Arbogast

work: Humboldt State University Web Office
personal: Interllectual.com
community project: Jangly Ganglia

Profile
 
 
Posted: 26 June 2007 10:51 AM   [ Ignore ]   [ # 10 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  507
Joined  2006-12-10

Having looked at the documentation and this thread, I’m still confused as to how I would add this regular expression to the dropdown menu to check for a price field:

[0-9]+\.[0-9][0-9]

How would I add ‘Price’ to the validation drop down, using this regex?

TY!

Profile
 
 
Posted: 07 July 2007 03:13 PM   [ Ignore ]   [ # 11 ]  
Lab Technician
Avatar
RankRankRankRank
Total Posts:  1401
Joined  2005-01-15

Wonderful Job! Thanks for sharing them Mark.

 Signature 

EE Duration Tags | {view_count_total}

Profile
 
 
   
 
 
Post Marker Legend
New Topic New posts Hot Topic Hot Topic with new posts New Poll New Poll Moved Topic Moved Topic Sticky Topic Sticky topic
Old Topic No new posts Hot Old Topic Hot Topic with no new posts Old Poll Old Poll Closed Topic Closed Topic Announcement Announcements
Theme
Change Theme
Visitor Statistics
The most visitors ever was 1149, on July 16, 2007 10:33 AM
Total Registered Members: 59014 Total Logged-in Users: 23
Total Topics: 69971 Total Anonymous Users: 12
Total Replies: 376984 Total Guests: 528
Total Posts: 446955    
Members ( View Memberlist )
Newest Members:  abahkinezoAdnan RajabrasstunerjishiHa.ahn.Mnmakoto kuwatawstuckey81unexpectedlyBelle