This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes variable passed to function result in objectHTMLInputElement Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "variable passed to function result in objectHTMLInputElement" Watch "variable passed to function result in objectHTMLInputElement" New topic
Author

variable passed to function result in objectHTMLInputElement

albert kao
Ranch Hand

Joined: Feb 04, 2010
Posts: 245
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.
 
wood burning stoves
 
subject: variable passed to function result in objectHTMLInputElement
 
Similar Threads
Javascript function trying to access Scriptlet value
JSON JQuery Grid Not getting value in JSP
Javascript onPaste
onKeyPress
how to know whether the browser is IE or netscape