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
0
votes
1 answer

I want to add required attribute in MUI TextField based on a condition

I want to add required attribute in MUI TextField based on a condition. Var flag = false If (investment>50000 && investment<5000){ flag = true } This doesn't…
0
votes
1 answer

How Can I Avoid This Warning ' A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from...'?

const AddItem = () => { const [user] = useAuthState(auth); const navigate = useNavigate(); const handleAddCar = (e) => { e.preventDefault(); const carObj = { name: e.target.name.value, supplier:…
0
votes
1 answer

How to prevent form submission without required fields?

I am creating forms elements like this: $element = $this->CreateElement('select', 'countries'); $element->setLabel('Countries'); $element->setAttrib( 'required', true ); $element->addMultiOptions( array( ''=>'Select', '1'=>'Aus','2'=>'UK',.... )…
Student
  • 1,863
  • 9
  • 37
  • 50
0
votes
1 answer

Laravel Validation Rules - require the field to be explicitly empty contingent on the value of another field (type_id)

The Problem I'm working on Invoice Lines. When the line type is 'Text Only' the price and quantity fields should be blank. When the line type is 'Item' the price and quantity fields are required. What Laravel already does: The required_if function…
Tim Ogilvy
  • 1,923
  • 1
  • 24
  • 36
0
votes
1 answer

Required field form by using id attribute in Javascript

here is my form. When user want to add another form they just click the "tambah bil". my problem is the function of required just detect the name of input filed. I want the function of required detect by the id of input field because it have the…
Nirah
  • 21
  • 1
  • 5
0
votes
1 answer

How can I automatically mark required field labels with a * (based on [Required] annotation) in a razor view using asp.net core 3.1/5 mvc?

How can I automatically mark required field labels with a * (based on [Required] annotation) in a razor view using asp.net core 3.1/5 mvc ? e.g. so a form would look like: * = required Name* : Age* : etc Is there a way to do this with a tag…
D.Man
  • 179
  • 1
  • 15
0
votes
1 answer

How to remove required filed

I'm new to coding and I want to know how to remove the required field in this code. Thank you. For example when the fields are empty I can submit without any error showing. > function valid_inf() { var errorUsername =…
Dj8lacko
  • 3
  • 1
0
votes
2 answers

The required attribute is not working in Chrome but does work in FireFox

I'm using bootstrap for styling and I've not defined any of my own classes. Since FireFox is working, I believe that the structure I'm using is correct. But Chrome is not happy, and I don't know enough about the nuances between the two to track it…
Display name
  • 1,228
  • 1
  • 18
  • 29
0
votes
1 answer

Disable option of required in webform in Drupal 7

My function: function _custom_get_ublox_communication_checkbox_form_element() { return array( '#type' => 'checkboxes', '#title' => t('Communications'), '#options' => array( 1 => t('I consent to retaining my personal data for…
syed1234
  • 761
  • 5
  • 12
  • 30
0
votes
1 answer

TextValidator showing browser validation messages when it is set to required

I'm using TextValidator from react-material-ui-form-validator, what I wanted was to display the '*' when an input is required in its input label. However, passing required as "true" was taking browser validation rather than the validators being…
SHAHBAZ
  • 316
  • 3
  • 15
0
votes
1 answer

How to Style Required Message Inputs and Textarea

I'm currently making a contact page for my website in Reactjs, but how would I go about styling the required message when I click Submit? I want the message to appear directly below the input or textarea, but how do I do that? Relevent Code
Daniel Zhang
  • 191
  • 2
  • 12
0
votes
2 answers

Csv import validation for Laravel constantly validating value as not present

I am using Laravel maatwebsite 3.1.3 row validation to validate a csv file import. But the WithValidation concern in my Imports php file is constantly throwing an error that the 2nd import row's last value is required even though the value is…
Hmerman6006
  • 1,622
  • 1
  • 20
  • 45
0
votes
2 answers

Required fields not met when closing window

I'm looking for the best way to go about "forcing" the user to fill a textarea. For my work we have a system that keeps track of time spent on a particular "task". Some tasks are required to have a comment while others are optional. At the top of…
Kashi
  • 25
  • 4
0
votes
1 answer

If a radio button is selected, require MULTIPLE text fields to be filled in to validate the form

I have a group of 3 radio buttons. If the last option labeled "In Home" is selected. All 4 of the text fields must be REQUIRED to be filled in in order for the form to validate. I have seen plenty of information on how to do this with checkboxes or…
user11199370
0
votes
1 answer

Woocommerce product rating only with stars

I am trying to make the woocommerce product rating only with stars. Therefore I need to remove the currently required fields name, email and comment. I have accomplished to remove comment with this code
hamirom
  • 49
  • 3
  • 11