Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2004-08-19
5
Medium Priority
?
135 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

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…
One of the typical problems I have experienced is when you have to move a web server from one hosting site to another. You normally prepare all on the new host, transfer the site, change DNS and cross your fingers hoping all will be ok on new server…
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…
Suggested Courses

610 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