Sunday, 15 August 2010

javascript - Unable to change the value of an input in a form to a variable -



javascript - Unable to change the value of an input in a form to a variable -

the thought behind page log loaded on page, , if 1 of lines in log matches criteria i've set regex for. you'll able click it, , line you've clicked passed page. javascript looks this

<% string variable ="this isnt going work"; %> <script type="text/javascript"> <!-- function a(){ document.form0.action = "page-to-navigate-to.jsp"; document.getelementbyid('genid').value= variable; //document.getelementbyid('genid').value="if come in text work"; document.form0.submit();} --> </script> < //code here calls function "a" > <form name="form0" method="post" target="_blank"> <input type = "hidden" name="genid"> </form>

i've excluded parts of code pattern matching done because can't seem simple string variable work this, comments mention. if type in anything, have typed in passed next page no problem.

i'm pretty new javascript may doing fundamentaly wrong

i'm greatfull help, thanks

this not javascript, server side code.

<% string variable ="this isnt going work"; %>

you might able do:

document.getelementbyid('genid').value = "<%=variable%>";

javascript html forms jsp variables

No comments:

Post a Comment