# Javascript parameter problem with onsubmit

**URL:** <https://www.ruby-forum.com/t/javascript-parameter-problem-with-onsubmit/128521>\
**Category:** Rails\
**Created:** [February 8, 2008, 12:04pm UTC](https://www.ruby-forum.com/t/javascript-parameter-problem-with-onsubmit/128521 "2008-02-08T12:04:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 8, 2008, 12:04pm UTC](https://www.ruby-forum.com/t/javascript-parameter-problem-with-onsubmit/128521/1 "2008-02-08T12:04:52Z")

</div>

Hi

I have this problem:

\<%= submit\_tag ‘Next’, {:onsubmit =\> ‘return  
validate\_options(param1,param2,param3);’} %\>

function validate\_options(params) {  
alert (params);  
return false;  
}

This does not seem to print out value param3. I only get that popup  
saying [object HtmlFormElement]

Its done like this since that form creating those param1 2 3 etc is  
dynamic so I dont’t know if there is  
param1 or param2 or even all of them. Now on validate\_options if need  
to check that if param1 is on the  
form it should check if that field is filled and if not then give out  
that pop up message.

any ideas ?
