required

Firefox 4 : Is there a way to remove the red border in a required form input?

自古美人都是妖i 提交于 2020-01-09 06:13:24
问题 When required is defined in a form field, Firefox 4 automatically shows a red border to this element, even BEFORE the user hits the submit button. <input type="text" name="example" value="This is an example" required /> I think this is disturbing for the user as he/she asn't made mistakes at the beginning. I wnat to hide that red border for the initial state, but show it when the user hits the send button if there is a missing field marked as required. I looked at :required and :invalid from

Require fieldset after checkbox checked

萝らか妹 提交于 2020-01-02 10:28:09
问题 I just started learning HTML/CSS, javascript and jQuery last week and would very much appreciate some help. I have created a form with a checkbox (id #ship_to_billing) and then a fieldset (id #shipping_info) containing 5 text fields. Using JQuery I've set it up so that, if that if the checkbox is checked, it toggles the other fields and hides them. But, I cannot figure out how to additionally require one or the other, either the checkbox has to be checked or all of the text fields within the

Composite component required=“true” not respected

 ̄綄美尐妖づ 提交于 2020-01-02 05:45:08
问题 In the composite:interface I have defined an attribute like this: <composite:attribute name="myAttribute" required="true"/> Now when I use my composite component like this, without defining any attributes: <myTag:myCC/> I would expect an error to occur. It doesn't. What could I possibly be missing? 回答1: It will only occur if your JSF project stage is set to Development as follows in web.xml : <context-param> <param-name>javax.faces.PROJECT_STAGE</param-name> <param-value>Development</param

Make a h:inputText required only when the checkbox is selected

不打扰是莪最后的温柔 提交于 2020-01-01 11:59:07
问题 I have a datatable with rows containing some input text fields that are required. Each row also has a check box called delete. I want to have the required = "true" only when the check box is selected. How can I achieve this? 回答1: Just let the input's required attribute check the checkbox's value. Here's a kickoff example: <h:form> <h:dataTable value="#{bean.list}" var="item"> <h:column><h:selectBooleanCheckbox binding="#{checkbox}" /></h:column> <h:column><h:inputText id="input" value="#{item

When to use the required attribute vs the aria-required attribute for input elements?

大城市里の小女人 提交于 2020-01-01 07:37:28
问题 I'm trying to make a form accessible. Should I make my inputs have both required and aria-required attributes, or just one? <label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" required> Or like this? <label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" aria-required="true"> Or like this? <label for="textbox1">Input</label> <input id="textbox1" type="text" name="Text Box" aria-required="true" required> The article Accessible

textarea's “required” attribute doesn't work even though the value is empty

风流意气都作罢 提交于 2019-12-30 03:50:40
问题 I created a simple page with list box and text area with conditions that all should be required. List box are working fine, but textarea box doesn't tell that the field is required to be filled. <!DOCTYPE html> <html> <head> <title>Ratings & Reviews</title> <body> <form> <span>Customer Service*</span> <span> <select name=customer id=aa required> <option selected="rate" value="" disabled>rate</option> <option value=1>1</option> <option value=2>2</option> <option value=3>3</option> <option

Angular dynamic required validation of group of fields with field highlight if invalid

天涯浪子 提交于 2019-12-25 04:22:54
问题 UPDATE 1: the question will be enhanced based on the feedback from the comments. UPDATE 2: Some progress has been made. Need additinoal help to get through. Please read below. UPDATE 3: Bug fixing in provided sample code causing duplication in table rows when compiling the element using $compile(el[0])(scope); . On page load, a list of field names is retrieved from Database which indicates what fields are required using ajax call getRequiredFieldInfo() . This call must be completed

How can I add condition based on the parameters of the array data on the rules Laravel?

瘦欲@ 提交于 2019-12-24 20:02:22
问题 I use Laravel 5.3 My rules Laravel like this : <?php namespace App\Http\Requests; use Illuminate\Foundation\Http\FormRequest; class AddCartRequest extends FormRequest { public function rules() { return [ 'product_id'=>'required|numeric', 'delivery_address'=>'required', 'request_delivery_at' => 'required|date_format:d-m-Y H:i:s|after:120 minutes' ]; } } The result of echo '<pre>';print_r($this->request->get('delivery_address'));echo '</pre>'; like this : Array ( [sender_name] => chelsea

how to? with knockout js validations

蹲街弑〆低调 提交于 2019-12-24 16:41:54
问题 I've started using knockout js validations with http://ericmbarnard.github.com/Knockout-Validation/ validation engine, and I'm not clear as to how to do the following: 1) Say I want to set a particular field required based on a condition. How do I do that? e.g. this.Username = ko.observable().extend({ required: true }); // make required = true only if this.UserType = 2, etc... 2) I've got the validation messages firing right next to the field being validated. I want only an '*' to appear next

Why is my jQuery script for checking required input fields so slow?

风流意气都作罢 提交于 2019-12-24 15:27:59
问题 I am trying to use jQuery to check for required input fields for browsers that don't reccognise the required HTML tag. My jQuery script is as follow. $('div').on('submit', '#myform', function(e){ e.stopPropagation(); e.preventDefault(); $( ':input[required]').each( function (e) { if ( this.value.trim() == '' ) { $('.error').html(this.name + " is required"); return false; } }); $(this).unbind().submit(); }); But it is very slow to load! after I click the submit button for the form, it takes