Click to See Complete Forum and Search --> : Copy and Paste without hidden text


aka Robbie
09-24-2008, 05:02 AM
Folks

I'm currently working on a page that contains a list of results for a search. One of the things required is hit highlighting for the search term.

So if you were to search for "stuff" it would return:
Dramatic stuff in Political Play

However we have made it accessible for speaking browsers such as JAWS. So it returns:
Dramatic hit stuff in Political Play

As such the html output is:
Dramatic <span class="hit"><span class="hiddenText">hit</span>stuff</span> in Political Play
where class "hit" does the bold, underline, highlighting etc for the browsers, and class "hiddenText" does the obvious and hides the word (to the left of the viewable area) "hit" unless read out.

Unfortunately if a user selects the text "Dramatic stuff in Political Play" and then tries to copy and paste it (into notepad or Word for example), they get "Dramatic hit stuff in Political Play".

Is it possible to do something so that if a user copies and pastes the word "hit" is not picked up?

Cheers

Michael_Burgess
09-24-2008, 05:27 AM
Are you using display:none on the hiddenText class?

EDIT: Yeah tried myself actually and see what you mean! Can't think of anything off the top of my head.

Fang
09-24-2008, 05:41 AM
JAWS does support onmouseover
Dramatic <span class="hit" onmouseover="alert('hit');">stuff</span> in Political PlaySomething like this should work.

Another option would be to remove the <span class="hiddenText">hit</span> using JavaScript. JAWS would not remove it, but other browsers would.