1,105,534 Community Members

textbox value to scriptlet

Member Avatar
Newbie Poster
1 post since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
<form name="myForm" method="post">         
  <textarea id="commentarea"></textarea>         
  <input type="text" name="locate" value="<%=rs.getString("location")%>">         
  <input type="button" value="View Comment" onclick="getComment()">     

function getComment(){   
  <% String locate=request.getParameter("locate"); %>   
  var location = "<%= locate%>";   
  document.getElementById('commentarea').value = location; 

I know this is the worst way to access it, but i need to access it in this way.
I want want the value of <%=rs.getString("location")%> to be the value of var location(in the javascript), i always get null, what should i do?

This article has been dead for over three months: Start a new discussion instead
Start New Discussion
View similar articles that have also been tagged: