Tuesday, April 3, 2012
Validating Forms without using JavaScript
http://www.cssjockey.com/web-design-tutorials/introduction-to-html5-forms-and-css3-pseudo-classes
CSS
HTML 5
CSS
input:required{ border-color:red; } input:optional{ border-color:whitesmoke; }
HTML 5
<input type="text" name="name" id="first-name" placeholder="enter you first name" required />
SpecsFor.Mvc, an independent library for automated acceptance tests
http://trycatchfail.com/blog/post/Using-SpecsForMvc-Introduction.aspx
public class when_a_new_user_registers_with_invalid_data : SpecsFor<MvcWebApp> { protected override void Given() { SUT.NavigateTo<AccountController>(c => c.Register()); } protected override void When() { SUT.FindFormFor<RegisterModel>() .Field(m => m.Email).SetValueTo("notanemail") //.Field(m => m.UserName).SetValueTo("Test User") --Omit a required field. .Field(m => m.Password).SetValueTo("P@ssword!") .Field(m => m.ConfirmPassword).SetValueTo("SomethingElse") .Submit(); } //...snip... }
Subscribe to:
Posts (Atom)