I need to update from prompt 1 param in , but i get all the time a a JavaScript error "Cannot set property 'value'".
I need to set the "rejectReason" param to what the user has written in prompt and them to submit the action.
So Here's the code please help me to assign the variable to the param
<apex:form>
<apex:commandButton action="{!processRejectButton}" onclick="rejectCandidate();" oncomplete="return location.reload();" value="Reject Candidate" id="theCommandLink">
<apex:param name="approveId" assignTo="{!approveId}" value="{!c.con.ID}"/>
<apex:param name="rejectReason" assignTo="{!rejectReason}" value="text" id="rejectReason"/>
</apex:commandButton>
</apex:form>
<script>
function rejectCandidate(){
var missing = prompt("Enter reject reason details", "aaaa");
if (missing != null && missing != "") {
document.getElementById('{!$Component.rejectReason}').value = missing;
}else{
alert("Please enter missing info details");
}
}
</script>