views:

219

answers:

3

Is there anyway I can get the value of a text field without posting a form. I would like to use the value somewhere else in the same page.

+1  A: 

You can use JavaScript. textarea elements have a value property that holds whatever text is in them.

Reinis I.
A: 

You can call a javascript function on any events (By example when your text field loose focus) and get the text field value by using the value property.

Patrice Bernassola
+2  A: 

The answer is to use some sort of client-side scripting.

With plain old Javascript, if your text field has ID 'textField':

document.getElementById('textField').value;

Or with jQuery:

$('#textField').text();
Matt Ball
thanks, that what I was looking for.
mnml