function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
lavanya gottumukkalalavanya gottumukkala 

passing value from inputText field to action method in commandLink

Hi All,
We have below code.
<apex:inputText id="advsearchfield" title="Go!" maxlength="80" size="18"/>
<apex:commandLink value="GO" id="btn" target="_parent" action="/search/SearchResults?searchType=2&search=Search&sen=0&str=" />
User will enter input into input text field and I want to pass that input into the action method below with out using controller.
Anybody has any idea?

Thanks in advance
bob_buzzardbob_buzzard
You'll need to use JavaScript for this - add an onclick handler to the commandlink that extracts the contents of the inputtext and appends this to the action. In fact you don't even need to use Visualforce tags for this, vanilla HTML will work just as well and remove a form thus cutting down on the viewstate size.
lavanya gottumukkalalavanya gottumukkala
Thanks for your update. search using above code we are able to get the value in onclick handler,but how to pass this value to query string( /search/SearchResults?searchType=2&search=Search&sen=0&str=)
bob_buzzardbob_buzzard
Access the target for the anchor tag and append the value to it.  There's an example of this at: http://stackoverflow.com/questions/3998496/change-the-href-of-an-anchor-tag-with-javascript