Solved

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

Posted on 2004-08-19
5
128 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Server specifications for web hosting 7 93
Two nodes for updates and forwarding 8 51
Web server load balancing technologies and methods 3 96
ColdFusion Rereplace 3 82
Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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.
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

820 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