所以现在我有一个表格......
<INPUT type="text" name="budget[unbudgeted_balance]" value="">
<INPUT TYPE="button" NAME="button2" Value="Get Funds Value" onClick="writeText(this.form)">
还有一些这样的咖啡脚本......
window.writeText = (form) ->
form.budget[unbudgeted_balance].value = "frack"
像这样翻译成JS...
window.writeText = function(form) {
return form.budget[unbudgeted_balance].value = "frack";
};
如果我这样做 name="budget" ...它可以工作。但是如果我做 name="budget[unbudgeted_balance]",它就行不通,为什么会这样。我该如何解决?