background preloader

Forms

Facebook Twitter

10 Tips To A Better Form. Introduction The most monotonous entities in the known universe, forms, are a staple of every web programmer’s balanced diet. Whether we like them or not, forms are the gatekeepers to our site’s goodies and often their design alone determines whether a user will try what you’re selling or simply walk away. Without pomp or circumstance, here are ten tips to transform your plain vanilla into double chocolate chunk with marshmallows. The Code The code examples below will not work “as is.” 1. We’ve notice a lot of people forgetting to use the tools that are already made accessible to them by the very medium that they work in. Label A label is used to attach information to a control. <label for="email">Email: </label><input type="text" id="email"> or <label>Email: <input type="text" id="email"></label> Fieldset “The FIELDSET element allows authors to group thematically related controls and labels.

Legend “The LEGEND element allows authors to assign a caption to a FIELDSET. Tabindex Accesskey Password. Page 6 - XML in the Browser: Submitting forms using AJAX. XML in the Browser: Submitting forms using AJAX - Submitting a Form(Page 6 of 6 ) Normally forms don't need any additional code to submit information, aside from any validation code that you choose to use. In this case, however, we will need to write some code to gather information from the form, and possibly from other areas of the application, to put into the proper format. One advantage this has over normal form submission is that you can include information that is not part of the form. No hidden form fields are necessary to make this work. As an example, let's take a simple form to allow a user to request a product catalog by mail (you remember mail: paper, stamps, etc.). The submission can start out at the click of a button or link. Var xmlReq = null;; function sub(f) { var file = 'testPost.php' var str = getFormValues(f,"validate"); xmlReq = getXML(file,str); } function getXML(file,str) { var doc = null if (typeof window.ActiveXObject !

The HTML for the form is simple. JotForm.