severndigital Posted October 20, 2008 Share Posted October 20, 2008 ok .. i have a very simple javascript function function textSize(indexNum,methodName){ var formName; formName = document.getElementsByName('textForm'); if(methodName == 'iFontSize'){ //add one to current font size and submit the form formName[indexNum].textSize.value++; document.textForm.submit(); }else if(methodName == 'dFontSize'){ //subtract one from current font size and sumbit the form formName[indexNum].textSize.value--; document.textForm.submit(); } } when i run the function is does the math correctly but javascript errors and says "document.textForm.submit is not a function. there are a few forms on the page, so I am using the index of the form to set the correct fields value. here is how i am invoking the javascript <form name="textForm" method="POST" action="process.php"> <input type="text" name="textSize" value="5"> <img src="add.gif" onClick="textSize(0,'iFontSize');"> </form> there is more to the form and the page, but that's the meat of this problem. any ideas?? Thanks, -C Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.