Solved

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Suggested Solutions

Introduction This article explores the design of a cache system that can improve the performance of a web site or web application.  The assumption is that the web site has many more “read” operations than “write” operations (this is commonly the ca…
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.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now