Questions tagged [required-field]

Indicates the required status of data field, where "required" is contrasted from "optional". Such status generally indicates that any [non-null] value is considered acceptable when populating or evaluating a specific field or fields.

Overview

The designation required-field indicates the required status of a data field, where "required" is contrasted from "optional".

Such status generally indicates that any non-null value is considered acceptable when populating or evaluating a specific field or fields.

This designation applies to any of various contexts, but is primarily associated with data-entry and data-validation.

136 questions
59
votes
14 answers

HTML required readonly input in form

I'm making a form. And on one input tag is an OnClick event handler, which is opening a popup, where you can choose some stuff, and then it autofills the input tag. That input tag is also readonly, so only right data will be entered. This is the…
Mathlight
  • 6,436
  • 17
  • 62
  • 107
50
votes
4 answers

Is it possible to configure a required field to ignore white space?

The required attribute in HTML5 is very handy: But it still allows users to enter white space only. Is there an HTML-only solution to this?
BenMorel
  • 34,448
  • 50
  • 182
  • 322
24
votes
11 answers

ExtJS 4 - Mark a red asterisk on an required field

I have this problem where I need to add a red asterisk beside a fieldLabel when a field is marked as "required" (or allowBlank: false) In ExtJS3, we can have this hack easily by overriding Ext.layout.FormLayout as…
Lionel Chan
  • 7,894
  • 5
  • 40
  • 69
15
votes
2 answers

Why does allow blank spaces?

When I set required="true" in a , it still allows blank spaces. I have been trying to modify the jsf-api.jar but I could not understand how to generate new a JAR, so I tried to modify the isEmpty() method from UIInput class and compile…
Ing.LkRuiZ
  • 262
  • 1
  • 3
  • 10
14
votes
3 answers

RequiredIf Conditional Validation for two variables in MVC4

I have a model class that is following public bool Saturday{ get; set; } public bool Sunday{ get; set; } public string Holiday{ get; set; } In which I want to use the RequiredIf condition for the Holiday field using the both Saturday and…
Md Aslam
  • 1,228
  • 8
  • 27
  • 61
13
votes
2 answers

commander.js : how to specify required cli argument

I'm using commander.js package for parsing command-line arguments: I'd like to make a flag non-optional, the API and tests in the git repo loosely mention making a flag required, but I usually need to be hit over the head with instructions. Is it…
asking
  • 1,435
  • 3
  • 13
  • 21
10
votes
1 answer

how to bypass required field validation when clicking the cancel button?

I've used HTML input type for my textboxes to utilize the required attribute. now my dilemma is i cannot go out of the page without filling-up the fields with required attributes. Ive tried using causeValidation set to false but its not working. i…
sd4ksb
  • 241
  • 1
  • 4
  • 16
10
votes
3 answers

How to set HTML5 attributes like 'required' using a Slim template

I m laying out a form using the Slim template language and want to add the required attribute to my input. input#first_name(required name="first_name" type="text" pattern="^[A-Z][a-z]+$") However the HTML that is generated from this ends up being …
Dave Sag
  • 13,266
  • 14
  • 86
  • 134
9
votes
2 answers

How to invoke a command button without validating all required inputs?

I'm trying to make a redirection from index.xhtml to registerFirstTime.xhtml. The code in the page index.xhtml is:
Víctor Pariente
  • 381
  • 2
  • 6
  • 18
8
votes
6 answers

checking each required input for empty value with jQuery

I am checking for each required fields in a form. I tried this but it only works for the first input. How can I make it work for each input? if($('[required]').val() != ''){ $('.button1').fadeIn(0); …
claras
  • 173
  • 2
  • 3
  • 11
7
votes
1 answer

html5 required validator not working with input type=button

Here is my html code
I have used html5 required field validators, it works but with a post back. so modified the code as follows to…
iJade
  • 23,144
  • 56
  • 154
  • 243
6
votes
2 answers

Combine jQuery preventDefault and required form inputs

Ok, so putting preventDefault on my submit button works to stop form submission. The consequence of this is that it won't tell the user of required fields and just performs the click event on the button. Adding preventDefault to the submit handler…
o_O
  • 5,527
  • 12
  • 52
  • 90
5
votes
1 answer

Required field in Django model not mandatory?

I have the following Django model: class Customer(models.Model): email = models.EmailField(unique=True) In my testcase, I instantiate it without an e-mail. class CustomerTestCase(TestCase): def…
physicalattraction
  • 6,485
  • 10
  • 63
  • 122
5
votes
1 answer

"formnovalidate" does not work on Chrome

For some reason, Chrome seems to validate the required fields even when the submit button has got the attribute formnovalidate. See http://jsfiddle.net/4LA9e/
Required field:
Gyum Fox
  • 3,287
  • 2
  • 41
  • 71
5
votes
4 answers

How to show multiple font colors inside the Text Field

i want text inside the text field like "your name* " the color of "your name" should be black and the color of * should be red. how can i do this?? Please help me.
khurram
  • 946
  • 1
  • 13
  • 34
1
2 3
9 10