sschleiffer
wading in the water Posts:21
|
02-24-2011 12:59 PM |
|
I want to have a user's textbox entry be validated for an exact match against a particular string (like a password, but NOT a password).
Let's say the string is 4X_a707nb.
What would I put in the validation regex field in the DF module? |
|
|
|
|
Candace
river guide Posts:2431
|
02-24-2011 01:26 PM |
|
Hi sschleiffer, You can try the compare validation you'll find when you edit the field under Field Validation. Thanks! Candace |
|
|
|
|
sschleiffer
wading in the water Posts:21
|
02-24-2011 02:55 PM |
|
I'm trying to get the user to enter a string they are given into a single textbox field and then click submit from this DF module.
That string, once validated somehow, will let the completion events fire, among which is a URL redirect to the real user profile page.
This is a part of my user organization driven complexity in registration and forms (paper ones) completion.
I tried a variety of combinations for regex and comparison thinsga nd get nowhere.My last effrot was to create a hidden textbox with an default value and compare the visible one to that. Since I have been typing in a wrong string every time on purpose, I know the comparisons are failing because it redirects me anyway.
Can you be more specific about a regex for my original quesiton, OR, more detailed in how to apply the comparison.
I have and have read the UG, but it not detailed enough for this question. E.g. do these strings need quotes around them in the regex or comparison Field Validation page settings? |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-25-2011 06:42 AM |
|
Hello sschleiffer,
You can take the approach of using SQL validation for this functionality. Is the string going to be static(won't change) or will it be dynamic(change)??
You can find SQL validation under Module Configuration -> Validation Configuration.
If it is a static value then the SQL validation will work best. You can add conditions in your SQL validation in case the string value can be dynamic.
If you have any questions please let us know.
Thanks,
Ryan
|
|
|
|
|
sschleiffer
wading in the water Posts:21
|
02-25-2011 08:31 AM |
|
Now you are suggesting I try a third means of validating this string. Is it not possible to do this with a regex, OR your Comparison thing, under the files's Field Validation? The string will be static, until the Admin changes it, in case it gets compromised. So, it needs to be editable by the Admin, but I expect not often. I need to know a Regex and the syntax for it, to place in the field on the Field Validation section, OR, I need to know how to configure the Comparison section. The UG is not detailed enough.
|
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-25-2011 10:34 AM |
|
Hello sschleiffer,
The most logical path is to use SQL validation or a compare validator on this question. It's really a coin toss.
For the compare field, you will need a hidden field that collects the static string value, from which ever table column you're storing it. You will have a question that's a textbox with a compare validator using the hidden field as the field to compare. This is easy to do.
For SQL validation, basically declare a SQL variable, gather the value the user entered and assign it to this variable. Now use a condition / compare the variable against the actual value. If the variable value doesn't match then invoke an error message. If true accept the submission of the form or whatever you're doing. This is easy to do.
The least logical path is to use a regular expression. What if the admin changes the string?? Then the regular expression will most likely have to change. This is possible, but the difficulty will ultimately make you lose sleep and cause frustration.
If you have any questions please let us know.
Thanks,
Ryan
|
|
|
|
|
sschleiffer
wading in the water Posts:21
|
02-25-2011 10:51 AM |
|
Posted By Ryan Bakerink on 02-25-2011 12:34 PM Hello sschleiffer,
For the compare field, you will need a hidden field that collects the static string value, from which ever table column you're storing it. You will have a question that's a textbox with a compare validator using the hidden field as the field to compare. This is easy to do.
I have most recently been trying to use a hidden filed with a sort order before the user entered question field. I had set a "default" value of the static string in that hidden field. I set up the question field with the compare check box and the hidden field selected from the dropdown. It passes anything I enter including nothing. Should I turn of the "required field" stuff? Does the Compare text fle dneed the statis string as well? THIS IS AN EDIT after the below post. |
|
|
|
|
sschleiffer
wading in the water Posts:21
|
02-25-2011 10:54 AM |
|
Okay, this is not the first tme I have had this other new problem. I just quoted the above, made minor edit to the quote and then wrote a lengthy reply with new questions and after it posts, the only thing there is the quote, before I edited it. Is this the most current AF or is it suffering from 5.6.1 as well? |
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-25-2011 10:58 AM |
|
Hello Sschleiffer,
This is the most recent AF, and it seems to have difficulties.
Make sure you copy your response before trying to post.
Thanks,
Ryan
|
|
|
|
|
Ryan Bakerink
river guide Posts:1900
|
02-25-2011 11:17 AM |
|
Hello,
I would use JavaScript Alert's to see the value in your hidden field or make the hidden field a text box so during testing, you can get the Compare field to work. Once you have it working, then change it back to a hidden field.
Thanks,
Ryan
|
|
|
|
|
sschleiffer
wading in the water Posts:21
|
|
Ryan Bakerink
river guide Posts:1900
|
02-28-2011 09:12 AM |
|
Hello Sschleiffer,
Please let me know if this technique helps you to accomplish the functionality you want.
Just keep me updated.
Thanks,
Ryan
|
|
|
|
|
Chuck
river guide Posts:157
|
02-28-2011 11:08 AM |
|
Posted By Ryan Bakerink on 02-25-2011 12:58 PM
Hello Sschleiffer,
This is the most recent AF, and it seems to have difficulties.
Make sure you copy your response before trying to post.
Thanks,
Ryan
Ugggh....I just had to edit this again. It happens to me quite often. I reply and my submission disappears. Also, if I quote, my reply disappears too. It gets frustrating to retype my responses. Sorry to hijack the topic. I wanted you to know it happens quite often for me. Thanks, Chuck |
|
|
|
|
sschleiffer
wading in the water Posts:21
|
|
Ryan Bakerink
river guide Posts:1900
|
03-30-2011 08:26 AM |
|
Hello Steve,
Thanks for the reference to the resource you've created for everyone.
If anyone has any questions please let us know, and I'm sorry about the Active Forums Chuck. I find that I will always copy the HTML of my post before I try to submit. That way I won't have to type my response again.
Thanks,
Ryan
|
|
|
|
|