1
Hello i have this form:<form method="post" action="Toplanti.jsp">
   <input type="hidden" id="dl" name="dl"  value="">

And this hs code:

<table>
<%for(int i=1;i<od.odasayisi()+1;i++){ %>
    <tr>
    <%for(int j=8;j<21;j++){  %>
        %><td id="bos">
        <input type="button" onclick="oda(<%=i%>)"><%} 

And this js function

    function oda(p){
    document.getElementById('dl').value=p
    var ad=document.getElementById('dl').value
    window.open("Odaici.jsp?a="+ad);
}

But this method does not get the parameter p.Is there a way to do this?Thanks

1
  • "But this method does not get the parameter p." — What value do you expect it to get? What does it actually get? What does the JavaScript in the onclick attribute (not the JSP that generates the JavaScript, the final JS you can see in the browser when you view source) look like? Commented Jul 11, 2014 at 6:36

1 Answer 1

1

You don't use semicolon

try this:

function oda(p){
   document.getElementById('dl').value=p;
   var ad=document.getElementById('dl').value;
   window.open("Odaici.jsp?a="+ad);
}
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.