Get value text from p:inputText javascript

Add id to your <p:inputText

like this

<p:inputText id="someID" value="any text" widgetVar="youtlink" ></p:inputText>

make sure your form got prependId="false"

than access the value like this

alert(jQuery('#someID').val());

if you don't want to add prependId="false" to your form you will have to change the jquery selector from jQuery('#someID').val() to jQuery("[id$='someID']").val()


EDIT

since your form called editlFrm

try this (make sure to assign someID id to your p:inputText)

alert(jQuery('#editlFrm\\:someID').val());

I came across this question when trying to do something similar, and discovered that PrimeFaces exposes a widget's JQuery element through the jq property.

So in your example, you could simply do:

function loadPlayer() {
    alert(youtlink.jq.val());
}

In more recent PrimeFaces versions (since 5.0), exported widgets seem to no longer pollute the global namespace, but need to be accessed using the PF() method. The JQuery element can however still be accessed in the same way.

function loadPlayer() {
    alert(PF('youtlink').jq.val());
}

My I think the simplest way:

PF('youtlink').jq.val();

You can set the value of input field like this:

PF('youtlink').jq.val('new value');

other way:

PrimeFaces.widgets.youtlink.jq.val()

and another way if you have ID:

$(PrimeFaces.escapeClientId("yourFormID:youtlink")).val()

tested with PF 5.3