show html5 validation callout popup manually - validation

I want to show html5 validation callout popup manually. I want to check if user enters wrong string pattern in text box then want to show validation callout same as we get by default in html5 when use flag required="required" in text box.

Have you tried the new functions of the form-element in html5?
You can find them at the bottom of this mdn page:
https://developer.mozilla.org/en/HTML/Forms_in_HTML

Related

KendoUI DateTimePicker (or similar) - make textbox un-editable but allow changing of date/time via provided buttons

I have a form which is using DateTimePicker on one of the inputs. I would like the user to be able to select the date/time by using the buttons which KendoUI attaches to the right of the input field, however I don't want the user to free-type into the text field (to save me having to verify formatting or rubbish input).
It is possible to add readonly attribute to the input, either in HTML or by calling .readonly() method on the DateTimePicker object. This makes the text field un-editable, however it also prevents the click events on the date/time selectors from firing.
So, how do I prevent the user from being able to edit the textbox field manually?
Thanks in advance.
Yes, you can set the readonly attribute only of the input from which the datepicker was created:
<input id="datepicker">
<script>
$("#datepicker").kendoDatePicker().attr("readonly", true);
</script>
Here is a live demo: http://jsbin.com/uwayit/1/edit

How to disable data annotation required field validator in MVC

I am trying to design a page that has two radio button options and two text boxes with each radio button. I am validating these text boxes using data annotation validation attribute.
I am using jquery slider.toggle() to display each text boxes according to the radio button clicked. When i submit the page, required field validators of both text boxes are triggered. What I want to do is to disable the first text box validation when the second radio button is clicked.
Is there any method in MVC to disable the validation of text boxes when the radio button associated to it is not selected?
This can be done rather simply front end. The validation which occurs is done based on html5's data attribute. Remove the data attributes from an input element and the validation will cease to function.

Dont validate input when FilteringSelect loses focus

Im using Dojo 1.5 to create a widget involving a FilteringSelect. It doesnt use autoComplete so the user is free to input what they like. By default it seems that when it loses focus it validates the content and displays the error message.
How can I customise it so that when the input loses focus it doesnt validate the content?
Just use the dijit.form.ComboBox instead.

MVC 3 Form validation

I have an app that is using standard out of the box form validation so when a user clicks the submit buttons and there are required fields not filled in, the validation message pops up next to the empty field. This is great, however, because our form is quite long we also like to display the same error messages at the top of the page in a bulleted list or something. Is there a quick way to do that? I can't seem to find where the validation is getting triggered in the jquery code to add new code to it. Anyone have any suggestions?
Thanks,
Rhonda
I figured out a way to do this that was quite simple. I just put a div at the top of the page and put all the #Html.ValidationMessageFor(m => m.Email) for every field in that div. This way they show up in both places.
Rhonda

curvycorners and jquery validate plugin - form focus issue

I am using "jQuery validation plug-in 1.7" for a page with form fields. The trouble is that the entire from is inside a rounded box created by using "CurvyCorners" plug-in. Since the error messages in my case appear below the form fields, the page size increases on appearance of each error message.
I am using 'curvyCorners.redraw();' on blur of each form element to achieve the page re-size. but every time it resizes the form fields loose focus and I am unable to tab properly in IE7 and below.
Any help would be highly appreciated
Can you please be specific about your error ?
And Try DD Roundies instead of curvy corners.

Resources