"textvalue" is a string {get;set in my controller. Onclick of button i want to get the value of "textvalue" in my script to do some validation.

<apex:inputText value="{!textvalue}" styleClass="slds-select" style="width : 57%;"/> 
<input id="recordHidden" type="hidden" name="theHiddenInput" value="{!textvalue}"/>
<Button  onclick="check();return false;">Enter This Reject Reason</Button>

function check(){

<apex:inputText value="{!textvalue}" styleClass="slds-select" style="width : 57%;" id="textId"/> 
var CaseSub= $('[id$=textId]').val();

By setting an id to input text you can get the value in script like above

  • It's fine (encouraged, even) to answer your own question, but I'd like to see more substance to your answer here. Explaining how this selector works, how it solved your question, and any changes that you might have needed to make to your markup (I don't see an Id value specified that would cause your selector to find anything) would help other people with similar questions figure out how to get themselves un-stuck. – Derek F Mar 22 '19 at 12:57
  • Thanks @DerekF .I have edited my answer properly . – jessy Mar 22 '19 at 13:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.