required

HTML form required command not working?

最后都变了- 提交于 2019-12-11 19:44:12
问题 I'm trying to get my form to require certain fields be filled out before the form can be submitted. I searched and found that the command is supposed to be this simple command <input type="text" name="name" id="name" placeholder="Name" required /> But for some reason on my form it submits it even when specified fields are not completed. I even tried creating a brand new file in Dreamweaver with a new form with just a required input item and submit button and tried it in different browsers and

How can I add a “Required” attribute to a dynamically-created (C#) element?

青春壹個敷衍的年華 提交于 2019-12-11 19:33:05
问题 I want to make some TextBoxes/text inputs "required" so that I can use the Validate jQuery validation plugin. I tried this: boxPayeeName = new TextBox { CssClass = "finaff-webform-field-input", ID = "payeeName", Required = true }; ...but "Required" is not recognized there; so I tried this: boxPayeeName = new TextBox { CssClass = "finaff-webform-field-input", ID = "payeeName" }; boxPayeeName.Attributes["required"] = "true"; I also tried this style of assigning to an attribute, on a similar

required on custom directive select

谁都会走 提交于 2019-12-11 11:35:05
问题 I have created my own select dropdown using an unordered list and ng-repeat. The problem with this directive is that it does not work as a normal select/input/textarea where you can use required when using it in a html form. So how do I implement the option required/ng-required (as directive) with validation on a custom directive? Should I use an own implementation of the validation? dropdown.html <!-- displayed text on the select --> <div class="title" ng-class="{'placeholder': !hasSelected(

Select option style change on submit when using “required” with Angular JS

瘦欲@ 提交于 2019-12-11 10:38:18
问题 Why do select option form elements change style when the form is submitted? HTML: <div ng-controller="TestController"> <form name="test" ng-submit="formSubmit()"> <select name="selectFormItem" ng-options="selectFormItemValue.value as selectFormItemValue.text for selectFormItemValue in selectFormItemValues" ng-required="true" ng-model="testModel" class="selectStyle"> <option value=""></option> </select> <button id="testSubmit" type="submit">Submit</button> </form> <br/><br/> <span>{

XmlElement required = true for Integer doesn't work

こ雲淡風輕ζ 提交于 2019-12-11 10:27:13
问题 I use jax-rs service. I have two fields in my class annotated with @XmlElement(required = true), one for Boolean, another for Integer. but if I send xml tags without value, for boolean I receive null, but for Integer I receive 0 @XmlElement(required = true) private Integer intValue; @XmlElement(required = true) private Boolean booleanValue; why I'm not receive null in Integer? 回答1: The required property on the @XmlElement annotation has no impact on the marshalling/unmarshalling performed by

Change a hidden input's value with jquery/javascript

眉间皱痕 提交于 2019-12-11 10:25:01
问题 I have some hidden input values that I would like to have be changed to a certain value once a user clicks on a link. 回答1: $('.someLink').click(function(){ $('.someHiddenInput').val('new value'); }); I think this is what you mean. HTML would look something like: <a href="#" class="someLink">click me to change value</a> <input type="hidden" name="hiddenVal" class="someHiddenInput" value="old value" /> 回答2: <input type="hidden" id="txtTextHdn" name="txtTextHdn" value="Y" /> <a href="#" id=

Zipcode validation that shows an error for particular states

喜夏-厌秋 提交于 2019-12-11 08:29:30
问题 I'm trying to create a form that pops-up an error when people insert a specific zip code or range of zip codes. For example: If a potential lead fills out a form and enters a Washington state zip code I'd then want an error to pop-up to say we don't offer the product in that state. I've search Google and Stackoverflow but still haven't found a working example of code... I've seen ones that are similar but not exactly what my example says. the example I'm looking for could be in javascript or

Required field display error message on form

杀马特。学长 韩版系。学妹 提交于 2019-12-11 07:50:03
问题 I have a form that I need to have required fields filled out. I know to use the code below to verify if the field is blank: <?php if (!empty($_POST['client_name'])) { echo '<p style="color:red;">'"Client Name is required!"'</p>'; } ?> My question is, how do I get the error message to display on the form page, saving all the data already entered in the form. Example: I fill out all 15 fields on the form, excluding the required field. When I hit the submit button, if the required field is empty

How can I add the 'required' attribute to input on change of textarea?

拜拜、爱过 提交于 2019-12-11 02:58:47
问题 I need to add the required attribute to an html select (toDept) under the condition that a textarea (orderComments) has text typed in it. Below is my code... What am I missing? Do I need to run my jquery on a change event or something? $(document).ready(function() { if ($('#textareaId').val() != '') { $("#selectId").attr('required', true); } } <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <textarea id="textareaId"></textarea> <select id="selectId">

HTML 5 required validator triggers on all buttons on the form

社会主义新天地 提交于 2019-12-11 02:46:24
问题 <asp:TextBox ID="txtCompanyName" runat="server" placeholder="Company Name" BorderColor="#C2C4CC" BorderStyle="Solid" Height="28px" Width="135px" title="Enter Company Name" BackColor="#F9E3CB" Enabled="False" TabIndex="7" required></asp:TextBox> Here is the mark up for one of my textbox with the "required" attribute. My question is, I have 3 buttons on my form, cancel, reset and submit button. the html5 required validator should only trigger when the submit button is clicked. however, it still