Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Required fields

Posted on 1999-07-07
4
Medium Priority
?
147 Views
Last Modified: 2010-04-09
Was wondering.... when setting up a form is there a way to require a field on the client side?

0
Comment
Question by:bhehir
[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
  • 2
4 Comments
 
LVL 9

Expert Comment

by:TTom
ID: 1851655
Do you mean require that a field be filled in before the form can be submitted?  If so, it is certainly possible; if not, can you explain a little more fully what you mean.  Forms are designed and delivered by the server.

Tom
0
 

Accepted Solution

by:
JCOLE earned 200 total points
ID: 1851656
I would suggest using a JavaScript function to validate required fields.

1) In the FOR tag, "onsubmit = return MyValidFunction()"
2) The Javascript function could be structured similar to this :

 if (document.FormName.FieldName.value.length==0) {
    alert("Please fill in the required field");
    return false;
  }else{
    return true

Hope this answers your question.
0
 
LVL 2

Expert Comment

by:djsansui
ID: 1851657
Yes.  How do you want to do it?  It can be done with JavaScript or CGI.

CGI is ideal (if you can have a CGI script on your server)
0
 

Expert Comment

by:JCOLE
ID: 1851658
Correction to my earlier response: I said to use the FOR tag. I meant to say use the FORM tag. Sorry about that.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

This is a PowerShell web interface I use to manage some task as a network administrator. Clicking an action button on the left frame will display a form in the middle frame to input some data in textboxes, process this data in PowerShell and display…
Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …

704 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