<input type="submit" [b]name="submit"[/b] id="..."/> The attribute name is [i]hardcoded[/i] to always have a value of "submit". This results into a situation where javascript form.submit() method cannot be invoked on the form without tweaking the submit button first. I was wondering if it is an unintentional consequence or a conscious decision to prevent the developers from using submit() method on the form in javascript.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I bound an event on the drop-down for onchange, which is supposed to
submit the form like this:
jQuery("#SelectPublicationGroup_publicationGroupId").change(function(){
document.forms['SelectPublicationGroup'].action = document.location.href;
// the next step needs to be done because submit button has name="submit"
// due to this form.submit is evaluated to an input element instead of a function which will
// cause javascript error "submit is not a function" on calling the submit() method
$("#SelectPublicationGroup_create").remove();
document.forms['SelectPublicationGroup'].submit();
});
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for the extra detail Vasanth. I thought there was some reason for this,
but looking around I can't find it. There isn't really a need for a name on a
submit button, so I've just removed it in the trunk (in commit 12843a3). If
anything breaks hopefully it will come up sooner than later... in basic
testing there were no problems.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Okay, I found the reason there was a name, and that is was hard-coded. If you
have multiple submit buttons (with different field names in the XML form) and
you want logic to see which one was pressed you can use the input value, but
only if they all have the same name. Basically in commit e6de970 it now always
uses "buttonName" instead of "submit" to avoid this problem, and the tools
screens that support multiple buttons have been updated to handle this change.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The submit "field" is always implemented as
Sorry, I haven't run into this issue. Could you provide more details about
what you tried to do and what happened (and in which browser, etc)?
I have a form definition like this:
I bound an event on the drop-down for onchange, which is supposed to
submit the form like this:
Thanks for the extra detail Vasanth. I thought there was some reason for this,
but looking around I can't find it. There isn't really a need for a name on a
submit button, so I've just removed it in the trunk (in commit 12843a3). If
anything breaks hopefully it will come up sooner than later... in basic
testing there were no problems.
Okay, I found the reason there was a name, and that is was hard-coded. If you
have multiple submit buttons (with different field names in the XML form) and
you want logic to see which one was pressed you can use the input value, but
only if they all have the same name. Basically in commit e6de970 it now always
uses "buttonName" instead of "submit" to avoid this problem, and the tools
screens that support multiple buttons have been updated to handle this change.