Here is the situation:
Code:
<!-- declare the array -->
<script type="text/javascript">
var prefix = new Array();
prefix['type'] = 'label';
prefix['text'] = 'more';
</script>
<!-- Call the function addField and attempt to pass the array -->
<input type="button" value="Add more field" onclick="addField(prefix);" />
I'm trying to pass an array into a function, which is called when the user clicks on the button but this does not seem to work. Any suggestion is really appreciated.
Thanks all.
|