1,105,386 Community Members

textbox value to scriptlet

Member Avatar
joannamanez
Newbie Poster
1 post since Dec 2011
Reputation Points: 0 [?]
Q&As Helped to Solve: 0 [?]
Skill Endorsements: 0 [?]
 
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()">     
</form>   

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?

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