May 18, 2011

JS Prototype - How to access value in FORM input text?

For example, if you have an input named "company" in a form with an ID "contact":

var form = $('contact');
var input = form['company'];

Form.Element.getValue(input);

// but, the preferred call is:
$(input).getValue(); // we used the $() method so the node gets extended

// you can also use the shortcut
$F(input);


http://particletree.com/features/quick-guide-to-prototype/

http://xavisys.com/using-prototype-javascript-to-get-the-value-of-a-radio-group/

No comments: