Passing the parent form on the onclick event to javascript function
Your script doesn't know what form
is. You need to specify document.forms[0].ip.value
instead.
If there are more than one form on the document then it will be better if you store the form element in variable first. You can have an id on the form for that...
<form id="formID">
and in submit_value function you can have
var myForm = document.getElementById('formID');
alert(myForm.ip.value);
Edit:
You can use this.form
for onClick of anchor tag.