Test the edit_text.js service


Just edit the contents of a DIV :
test2

Change the value of a HTML element (div, span) strip the spaces and copy the new value
test1

(this is where the new value is pasted)


You can constrain the values to numbers (hexa, decimal) with the "check" function, that gets the "this" of the text field.

test3


Or constrain the values to alphanumeric characters

test4


The filter can also indicate if the value is correct (saving the value is inhibited otherwise).

456789

Here, only values below 100 are accepted.
Set edit_text.valid to false if you don't like the value.


Once you're happy with the number that you have input, you can get it and do more stuff, such as alert()ing it :

456789

Since the text field is not displayed anymore, the string is in (argument).source of func.