Solved

Hi! how do i use the hidden field in <form></form> to make a field required?

Posted on 2004-08-19
5
127 Views
Last Modified: 2013-12-24
Hi,

how do i use the hidden field in <form></form> to make a field required?

I was thinking of using hidden field so it will prompt the user that it is required.

This is what i have

<input type="hidden" name="CUlast_required">
  <input type="hidden" name="CUfirst_required">
  <input type="hidden" name="CULogin_required">
  <input type="hidden" name="CUPass_required">
  <input type="hidden" name="CUDeptID_required">
  <input type="hidden" name="CUserRoleid_required">


Do I have to include anything in my <input type="text" name="CUlast" id="CUlastAdd" size="15" maxlength="20">

Thanks
0
Comment
Question by:mdbbound
  • 3
5 Comments
 
LVL 21

Expert Comment

by:pinaldave
ID: 11848979
<cfinput
   type = "Text" name = "MyPhone"
   message = "Enter telephone number,formatted xxx-xxx-xxxx (e.g. 617-761-2000)"
   validate = "telephone" required = "Yes">
   <font size = -1 color = red>Required</font>

This is one of the example.
Though you will have to use <cfform></cfform>
now looking at your example:
<cfinput type="text" name="CUlast" id="CUlastAdd" size="15" maxlength="20" message="please enter this id" required = "YES">

This will work. There is one more way to do this also. I will post it soon.
Personally I do not like to use <cfform> do not know why? Smile.
Regards,
---Pinal
0
 
LVL 21

Accepted Solution

by:
pinaldave earned 500 total points
ID: 11849001
Hi mdbbound,

http://livedocs.macromedia.com/coldfusion/6/Developing_ColdFusion_MX_Applications_with_CFML/formatData8.htm

<input type="text" name="CUlastAdd" id="CUlastAdd" size="15" maxlength="20">
<input type="hidden" name="CUlastAdd_required"       value="You must enter a data.">

This will work if you are not using CFFORM and CFINPUT

You can have wonderful referance at the site I mentioned on the top.
Hope this helps,
Regards,
---Pinal
0
 
LVL 17

Expert Comment

by:anandkp
ID: 11849536
if ur asking for HTML validations - u have the answer above.
0
 
LVL 35

Expert Comment

by:mrichmon
ID: 11853501
In general it is better to write your own validation and not have CF generate code to make required fields as the generated code is not very good nor very user friendly...
0
 
LVL 21

Expert Comment

by:pinaldave
ID: 11959138
hello Mdbbound,
Thank you again,
Good Day buddy,
---Pinal
0

Featured Post

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Have you ever sent email via ColdFusion and thought of tracking this mail to capture the exact date and time when the message was opened ?  If yes, then this article is for you ! First we need a table user_email with columns user_id , email , sub…
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 Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

776 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