Copyright ©

Prototype $F() Method

previous next


The $F() function returns the value of any field input control, like text boxes or drop-down lists. This is a convenience alias of Form.Element.getValue.

The function can take as argument either the element id or the element object itself.



Return Value:


<title>Prototype examples</title>
<script type="text/javascript" 

function ShowValue(){
      var value = $F('userName');

      alert( 'Entred  Value :' + value);


   <p>Enter any value in the box and then click "Show Value"</p>

   <input type="text" id="userName" value="Madisetti, Praveen">

   <input type="button" value="Show Value" onclick="ShowValue();"/>


To understand it in better way you can Try it yourself.

previous next

Copyright ©