• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

<input> with regular expression

Guest
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

I am wondering how to use the _regex in a hidden <input>. i have searched every where but there is no examples on how to use this cfml form validation. Its not that i want alternatives to do the regular expression just how to use it like this......

if i had the form....

<form.........>
<input name="email">
<input type="hidden" name="email_regex" value="*/.............">
</form>


How can i have a message if the input email does not coincide with the regular expression. would i need to use a second
<input type="hidden" name="email_regex_Required" value="please insert a valid email adress>




TOPICS
Advanced techniques

Views

805

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

Sounds like you need to use javascript (JS). CF doesn't know the value if the 'email' field until you've submitted the form.
Of course JS can work with CF vars too so assuming the hidden field contains a CF var, send the form to a JS function to compare the 2 fields when you submit. Then submit the form or return the error accordingly..

Jam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

i am trying to get it to work like this. The validation type is valid but i have not found anything on how to use it properly.

it like using the
<input type="hidden" name="email_required" value="the field is blank, please go back and enter a filed">

I know javascript is the best option but if the browser does not support this then at least in can attempt a alternative method. All i would like to know is how do i use this validation type and how can i get it also to produse a error message. as the "value" field will contain the regular expresion itself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

i am trying to get it to work like this. The validation type is valid but i have not found anything on how to use it properly.

it like using the
<input type="hidden" name="email_required" value="the field is blank, please go back and enter a filed">

I know javascript is the best option but if the browser does not support this then at least in can attempt a alternative method. All i would like to know is how do i use this validation type and how can i get it also to produse a error message. as the "value" field will contain the regular expresion itself.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

To use cf validation you need a CFFORM and CFINPUT field.

<cfinput name="email" type="Text" required="Yes" message="the field is blank, please go back and enter a filed">

Can you post the actual code from the page please and then explain at what point the hidden field is populated?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

sorry my mistake the it is _cfformregex _cfformregular_expression. how do you use these........

http://livedocs.macromedia.com/coldfusion/7/htmldocs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=C...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

<cfinput type="Text"
name="email"
message="Valid email address required..."
validate="Regular_expression"
required="Yes"
pattern="your_REGEXP">

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
May 12, 2006 May 12, 2006

Copy link to clipboard

Copied

this is a cfinput though. it is also possible to do this in an input and this is what i am trying to understand how to use........

http://livedocs.macromedia.com/coldfusion/7/htmldocs/00001385.htm#1154690

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
May 15, 2006 May 15, 2006

Copy link to clipboard

Copied

LATEST
Hi - Been away!
If you're still looking at this - I think you want to use the (MX7) form validation on standard html and form elements:

(I think) MX7 is like this:
<input type="hidden" name="emailAdress_ cfformregex" value="your_reg_exp">

<!--- I think you have to add another hidden field if you want to make it mandatory...
<input type="Hidden" name="emailddress_required" value="Email address is required...">
--->

<input type="Text" name="emailddress">

but you'll have to experiment...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation