here is what I have.
Form
<form id="form" name="myForm" action="https://websiteSubmittingto.com" method="POST">
<label>inputfield1</label><br/><input type="text" name="inputfield1" style="width:150px;"/><br/>
<label>inputfield2</label><br/><input id="inputfield2" name="inputfield2" style="width:150px;"/><br/>
<input type="submit" value="submitto" onclick="getSub()" />
</form>[code]
Javascript
[code]
var userentered = document.getElementById("inputfield2");
var form = document.forms[myForm];
function getSub(){
//form.elements["inputfield2"].value = forms.elements["inputfield2"].value.substring(0,8);
document.alert(form.elements["inputfield2"].value.substring(0,8));
}
I have tried putting a onsubmit on the form tag but that got me no where. If someone could help me out that would be great.
This post has been edited by eddiehm: 19 July 2011 - 07:30 PM

New Topic/Question
Reply



MultiQuote





|