Hi, i tried the following to use a string from asp code in javascript but it didnt work....please tell me how to pass a string to a javascript Code: <script language="JavaScript"> function ChangeAll(f) { alert(f); } </script> <% r="here" response.write("<form method='post'>") response.write("<input type='button' value='Submit' onClick='ChangeAll(''"&r&"'')' ") response.write("</form>") %>
Probably the code should look like this, Code: <script language="JavaScript"> function ChangeAll(f) { alert(f); } </script> <% r="here" response.write("<form method='post'>") response.write("<input type='button' value='Submit' onClick='ChangeAll("""&r&""")' ") response.write("</form>") %>
Hi, Check this Instead try following code Code: <input type='button' value='Submit' onClick='ChangeAll("value of r")'> Thanks