Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

variable passed to function result in objectHTMLInputElement

 
albert kao
Ranch Hand
Posts: 252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I like to pass a global variable to a function but
<script type="text/javascript">
var sortorder = true;
</script>

<input type="checkbox" name="choice" value="20" onchange="submitField(document.alertform.choice, 20, sortorder);">

This function is defined a file:
function submitField(field, id, sortorder) {
alert('sortorder ' + sortorder);

}

The alert box "sortorder [objectHTMLInputElement]" appear instead of "sortorder true".
Please help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic