Fork me on GitHub

Example: Basic url field creation

How to create a url field.

Basic UrlField creation

Use the following code to create a basic inputEx UrlField.

favicon option

If you use https, you might need to remove the favicon option (or provide a proxy).

Placeholder

You can use all the parameters from StringField, including "placeholder":

HTML

<div id="field-container"></div>

JavaScript

Implementation

YUI().use('inputex-url',function(Y) {

    // Example 1
    new Y.inputEx.UrlField({
        parentEl: 'container1',
        showMsg: true,
        value: 'http://ajaxian.com/archives/inputex-json-form-builder'
    });


    // Example 2
    new Y.inputEx.UrlField({
        parentEl: 'container2',
        showMsg: true,
        favicon: false,
        value: 'http://www.ajaxian.com'
    });


    // Example 3
    new Y.inputEx.UrlField({
        parentEl: 'container3',
        showMsg: true,
        favicon: false,
        placeholder: 'webservice url'
    });

});