Sunday, 15 August 2010

java - how to pass value from javascript to hidden field -


Hello I have a javascript method that reads the byte head from applet class, I pass the request scope to that bit array Want to control the controller class? For this, I have filed a hidden code and here I am suspecting that how can I pass that byte array from the field hidden from the Java Script method, any body can give a solution.

Here's my JSPP class.

  & lt; Html & gt; & Lt; Body & gt; & Lt; Script type = "text / javascript" & gt; Var a = "image"; Function printIt () {a = document.getElementById ('string'). Values; } & Lt; / Script & gt; & Lt; Form name = "formName" verb = "second.jsp" & gt; & Lt; Input type = "hidden" value = 'a' name = "name" id = "string" /> & Lt; Input type = "submit" id = "abcId" name = "abcName" onsubmit = "printIt ()" value = "submit" /> & Lt; / Form & gt; & Lt; / Body & gt; & Lt; / Html & gt;  

Here you can try using jquery code to achieve it :

& lt; Script type = "text / javascript" & gt; $ ('# AbcId') ('Click', function () {var a = "image"; $ ('# string'). Val (a); // & lt; - This code is a variable value, such as hidden input $ (' Submit to ();}

HTML code

  & lt; input name = "Formname" action = "seconds.jsp" id = "form id"> input type = "hidden" value = 'a' name = "name" id = "string" /> gt; & lt; input type = "Submit" id = "abcId" name = "abcName" value = "submit" />  

No comments:

Post a Comment