Showing posts with label AngularJs. Show all posts
Showing posts with label AngularJs. Show all posts

Monday, May 28, 2018

“md-select” - How to set a selected option of a dropdown list control using angular JS?

Try this following code to set selected value based on selected index.

<div layout="row" flex layout-align="start">
	<md-input-container flex>
		<label>{{'TicketType_Label'| translate}}</label>
		<md-select ng-model="feedbackObj.ticketType"  ng-required="true" md-no-asterisk="false" >
			<md-option ng-selected="i == 0 ? true:false"  ng-repeat="(i,type) in TicketTypes" >{{type}}</md-option>
		</md-select>					
	</md-input-container>
</div>

Wednesday, September 14, 2016

Disable Popup “Please Fill Out this Field” hover text on browsers

This is message “Please fill out this field” is browser default message which comes from browser when we have required fields in the page.

This his how browsers handles the HTML5 "required" attribute. Since those fields have the attribute "required", the browser adds that message on hover.  I have seen this in Mozilla and Chrome versions.

Simple fix for this issue is use formnovalidate in whatever button that triggers the prompt or simply use novalidate in form tag. Either one is sufficient to disable browser default validation

Example:

<form action="post.ashx" method="post" novalidate>
<input type=submit formnovalidate name=save value="Save">
<input type=submit formnovalidate name=cancel value="Cancel">
</form>

Find out more here using AngularJs