I've done a couple of experiments to see if you can select text using Javascript. For instance, suppose you have a textarea with id="editarea"
You could tie to clicking a button the following code: var myField = document.getElementById("editarea"); alert("hi there"+myField.selectionStart) myField.setSelectionRange(0,10);
In my tests, the selectionStart does return a non bogus value if you have clicked somewhere within a textarea previously. So the selectionStart/selectionEnd properties of textareas work. However, unlike the non-iphone Safari, the line myField.setSelectionRange(0,10); does not highlight the first 10 characters of the textarea. Still manipulation of textareas can be done with the iPhone. So here is a way to do limited cut and pasting within a textarea. (Unfortunately, selected regions wouldn't be highlighted). Use Javascript so that when you type the letters '.@' (on the first iPhone keyboard screen) in a textarea, it searches earlier in the text area for the letters '@.' the region between these two is then cut out by manipulating the string of the textareas value. Next to ones text area one has a paste button. When one clicks this the last text that was previously cut is pasted back at the current value of selectionStart
I've done a couple of experiments to see if you can select text using Javascript. For instance, suppose you have a textarea with id="editarea"
You could tie to clicking a button the following code: var myField = document.getElementById("editarea"); alert("hi there"+myField.selectionStart) myField.setSelectionRange(0,10);
In my tests, the selectionStart does return a non bogus value if you have clicked somewhere within a textarea previously. So the selectionStart/selectionEnd properties of textareas work. However, unlike the non-iphone Safari, the line myField.setSelectionRange(0,10); does not highlight the first 10 characters of the textarea. Still manipulation of textareas can be done with the iPhone. So here is a way to do limited cut and pasting within a textarea. (Unfortunately, selected regions wouldn't be highlighted). Use Javascript so that when you type the letters '.@' (on the first iPhone keyboard screen) in a textarea, it searches earlier in the text area for the letters '@.' the region between these two is then cut out by manipulating the string of the textareas value. Next to ones text area one has a paste button. When one clicks this the last text that was previously cut is pasted back at the current value of selectionStart
Agreed! This is very important for those of us wishing to replace our Palms. When you have recurrent appointments at variable times cut and paste is a must!
I've done a couple of experiments to see if you can select text using Javascript. For instance, suppose you have a textarea with id="editarea"
ReplyDeleteYou could tie to clicking a button the following
code:
var myField = document.getElementById("editarea");
alert("hi there"+myField.selectionStart)
myField.setSelectionRange(0,10);
In my tests, the selectionStart does return a non bogus value if you have clicked somewhere within a textarea previously. So the selectionStart/selectionEnd properties of textareas work. However, unlike the non-iphone Safari, the line myField.setSelectionRange(0,10); does not highlight the first 10 characters of the textarea. Still manipulation of textareas can be done with the iPhone. So here is a way to do limited cut and pasting within a textarea. (Unfortunately, selected regions wouldn't be highlighted). Use Javascript so that when you type the letters '.@' (on the first iPhone keyboard screen) in a textarea, it searches earlier in the text area for the letters '@.' the region between these two is then cut out by manipulating the string of the textareas value. Next to ones text area one has a paste button. When one clicks this the last text that was previously cut is pasted back at the current value of selectionStart
I've done a couple of experiments to see if you can select text using Javascript. For instance, suppose you have a textarea with id="editarea"
ReplyDeleteYou could tie to clicking a button the following
code:
var myField = document.getElementById("editarea");
alert("hi there"+myField.selectionStart)
myField.setSelectionRange(0,10);
In my tests, the selectionStart does return a non bogus value if you have clicked somewhere within a textarea previously. So the selectionStart/selectionEnd properties of textareas work. However, unlike the non-iphone Safari, the line myField.setSelectionRange(0,10); does not highlight the first 10 characters of the textarea. Still manipulation of textareas can be done with the iPhone. So here is a way to do limited cut and pasting within a textarea. (Unfortunately, selected regions wouldn't be highlighted). Use Javascript so that when you type the letters '.@' (on the first iPhone keyboard screen) in a textarea, it searches earlier in the text area for the letters '@.' the region between these two is then cut out by manipulating the string of the textareas value. Next to ones text area one has a paste button. When one clicks this the last text that was previously cut is pasted back at the current value of selectionStart
Agreed! This is very important for those of us wishing to replace our Palms. When you have recurrent appointments at variable times cut and paste is a must!
ReplyDeleteGREAT ITEM!!! Spell Check for email. View WORD AND EXCELL DOCUMENTS WITHOUT USING THE INTERNET. TO SLOW....
ReplyDeleteTODO LIST, A CALENDAR WITHOUT A TODO LIST???
JAVA.....
THANKS ALL, JUST A LITTLE WISH LIST!! GREAT PHONE!!!