Selected text for HTMLInputElement

Friends.

Is it possible at all to find the selected text of an HTMLInputElement???

Is there any known way to access it.

SOS. :((

Thanks in advance & Regards
Sanjay

Comments

  • Hi,

    : Is it possible at all to find the selected text of an
    : HTMLInputElement???
    :
    : Is there any known way to access it.

    Maybe JavaScript is the answer? I don't know JavaScript too well, but I think you'd maybe do it like:-

    var whatsinbox = document.NameOfForm.NameOfElement.value;

    What do you want to do with the data once you've accessed it?

    Jonathan




    -------------------------------------------
    Count your downloads:
    http://www.downloadcounter.com/
    And host your site:
    http://www.incrahost.com/
    Don't say I never give you anything... ;-)

  • Hello pal.

    I do not want the whole value... I wish to get the "selected" text only.

    Once I have it... I will apply some application logic on it.

    Any clues.

    : Hi,
    :
    : : Is it possible at all to find the selected text of an
    : : HTMLInputElement???
    : :
    : : Is there any known way to access it.
    :
    : Maybe JavaScript is the answer? I don't know JavaScript too well, but I think you'd maybe do it like:-
    :
    : var whatsinbox = document.NameOfForm.NameOfElement.value;
    :
    : What do you want to do with the data once you've accessed it?
    :
    : Jonathan
    :
    :
    :
    :
    : -------------------------------------------
    : Count your downloads:
    : http://www.downloadcounter.com/
    : And host your site:
    : http://www.incrahost.com/
    : Don't say I never give you anything... ;-)
    :
    :

  • Hi,

    : I do not want the whole value... I wish to get the "selected" text
    : only.
    :
    : Once I have it... I will apply some application logic on it.
    :
    : Any clues.

    Hmmm...I'm not much good on JavaScript! But this seems to display the currently selected text:-

    alert(document.selection.createRange().text);

    Any good?

    Jonathan


    -------------------------------------------
    Count your downloads:
    http://www.downloadcounter.com/
    And host your site:
    http://www.incrahost.com/
    Don't say I never give you anything... ;-)

  • Thats impressive....!!

    Many Thanks.

    : Hi,
    :
    : : I do not want the whole value... I wish to get the "selected" text
    : : only.
    : :
    : : Once I have it... I will apply some application logic on it.
    : :
    : : Any clues.
    :
    : Hmmm...I'm not much good on JavaScript! But this seems to display the currently selected text:-
    :
    : alert(document.selection.createRange().text);
    :
    : Any good?
    :
    : Jonathan
    :
    :
    : -------------------------------------------
    : Count your downloads:
    : http://www.downloadcounter.com/
    : And host your site:
    : http://www.incrahost.com/
    : Don't say I never give you anything... ;-)
    :
    :

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories