Prevent malicious user from executing JavaScript
<p>In my JSP I have a function like <code>fnGetTicketDetails</code>: </p>

<pre><code>function fnGetTicketDetails(record){
    $("#TicketNumber").val(record);
    $("#TicketDetailsForm").submit();
    return false;
}
</code></pre>

<p>I have form like this:</p>

<pre><code>&lt;form name="TicketDetailsForm" id="TicketDetailsForm" method="post" action='${properties["SUBMIT_TICKET_DETAIL"]}'
    target="_blank" style="display: none;"&gt;
</code></pre>

<p>I have an input hidden parameter </p>

<pre><code>&lt;input type="hidden" name="record" id="TicketNumber" /&gt; 
</code></pre>

<p>It is working fine in the server. Issue was: If I use </p>

<pre><code>javascript:eval("fnGetTicketDetails(83769551); eval();");
</code></pre>

<p>in the browser then also I am getting the details, which is invalid. How to block these type of request from browser. Because a hacker can easily get the details if he knows the ticket number.</p>
