Jefficus
09-09-2004, 05:11 PM
I tried this question in the HTML group but haven't had any responses. It occurs to me that it might be better suited to the Javascript group, so here goes...
I have a site I'm putting together that has a LARGE block of text, perhaps as long as 50,000 words.
I want to present a form to the user that allows him to select a passage from this block of text - anywhere from one word to the entire block.
But when I get the form submission, I don't want to receive the quoted text as input, I want to receive the range of word numbers. (Receiving the quoted string itself would be ambiguous, as the same sequence of words might occur several times in the block.)
Suppose the passage was "Fourscore and seven years ago today our fathers kicked some butt and took some names." If the user selects the words "ago today our", I want to recieve a form submission with the values 4,5,6 (or maybe 4-6) but not "ago today our".
I am looking for some suggestions on how to achieve this. I *COULD* just show a form with every single word and put a checkbox in front of each word. But that would be hideous.
Does anybody know a more elegant way to handle this? Should I be looking at adapting a client-side Java applet text editor? If so, any suggestions on which one? Is there a better way?
Venturing into new territory,
Jefficus
I have a site I'm putting together that has a LARGE block of text, perhaps as long as 50,000 words.
I want to present a form to the user that allows him to select a passage from this block of text - anywhere from one word to the entire block.
But when I get the form submission, I don't want to receive the quoted text as input, I want to receive the range of word numbers. (Receiving the quoted string itself would be ambiguous, as the same sequence of words might occur several times in the block.)
Suppose the passage was "Fourscore and seven years ago today our fathers kicked some butt and took some names." If the user selects the words "ago today our", I want to recieve a form submission with the values 4,5,6 (or maybe 4-6) but not "ago today our".
I am looking for some suggestions on how to achieve this. I *COULD* just show a form with every single word and put a checkbox in front of each word. But that would be hideous.
Does anybody know a more elegant way to handle this? Should I be looking at adapting a client-side Java applet text editor? If so, any suggestions on which one? Is there a better way?
Venturing into new territory,
Jefficus