Solved

FLASH FORM/CFINPUT

Posted on 2007-11-15
2
402 Views
Last Modified: 2013-12-24
I didn't get any responses on this question except an email telling me I didn't get any responses and I must have not worded the question correctly or I put it in the wrong zone...well I read the question over and I don't see how i could have been more explicit on what I was asking and I put it in the confusion zone because that is where I am building.  So I'm not sure what else to put here...so here is still my question, please.

Is there a way to validate a field in a flash form within cfinput that states the user MUST have entered exactly 6 characters in the field.  The field is alpha numeric so it's not like i can use a range and i have the maxlength attribute attached but that just keeps the end user from entering more than 6 characters but allows them to add less than 6 (but we can't have that).  Here is the code I am using for the cfinput field:
<CFINPUT name="strField01"
       label="User ID:"
      width="200"
      align="left"
      mask="AA999X"
      maxlength="6"
      required="yes"
      validate="noblanks,maxlength"
      message="You must enter the users ID and in the proper format XX9999 or XX999X.">
0
Comment
Question by:Lee R Liddick Jr
2 Comments
 
LVL 9

Accepted Solution

by:
73Spyder earned 400 total points
ID: 20422585
I've not used flash forms much but here is solution I stumbled across.  Perhaps it will help.
http://photos.sys-con.com/story/res/42052/source.html
Listing 1
<script language="JavaScript">
function validatePassword(form,field,value) {
if (value.length < 6) {
return 0;
}
else {
return 1;
}
}
 
</script>
 
<cfform name="form1">
<table>
<tr>
<td>Password:</td>
<td><cfinput type="Password" name="pw"
message="Please enter a password of at least 6 letters"
onvalidate="validatePassword"></td>
</tr>
<tr>
<td>Text:</td>
<td><TEXTAREA name="address" rows="3" cols="26"></TEXTAREA>
<!-- <CFINPUT name="address" required="yes"
message="Please enter some text"> -->
</td>
</tr>
 
<tr>
<td>&nbsp;</td>
<td><input type="submit" value="Check"></td>
</tr>
</table>
</cfform>

Open in new window

0
 

Author Closing Comment

by:Lee R Liddick Jr
ID: 31417178
I forgot this was still open as I went a different route.  I will try this when I get a chance but will provide you with the points since nobody else had responded.  I thank you for your help and pointing me in the right direction to assist in my question.  Thanks again...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In our day to day coding, how many times have we come across a necessity to check whether a URL is a broken link or not? For those of you that answered countless and are using ColdFusion like myself, then this article is for you.  It will show yo…
If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question