hi to all there i have problem with links management, my problem is that i want to pass the resultSet object to javascript function but it can all me do this but display error undefine link value or object value is null my code is

function hyperlinkvalue(passvalue)
{
 
  var hyper=passvalue;
  alert(hyper);
document.formName.textfieldtoassignlinkdata.value=hyper;
}
//"ref is the Arraylist"
// i is the integer of for loop 
  <a href="<%=ref.get(i).toString()%>" name="<%=i%>" onclick="hyperlinkvalue(<%=ref.get(i).toString()%>)"><%out.println(ref.get(i).toString()); %></a>

plz plz plz help me out of this problem

Your source code should be surrounded by BB code tags.

...
  <script type="text/javascript">
    function hyperlinkvalue(passvalue) {
        var hyper=passvalue;
        alert(hyper);
        document.formName.textfieldtoassignlinkdata.value=hyper;
    }
</script>

//"ref is the Arraylist"
// i is the integer of for loop

for(i=0;i<ref.size();i++) {
 %>
   <a href="<%=ref.get(i).toString()%>" name="<%=i%>" onclick="hyperlinkvalue("<%=ref.get(i).toString()%>")"><%out.println(ref.get(i).toString()); %></a>
<%
 }
%>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.