I have a lovely form that allows me to add_new records, edit records, or delete records for a database table. What was missing was an extra submit button to allow me to edit an existing record and save it as a new record. Piece of cake! I’ve done it many times. Until today. Today I get the VAGUE Javascript error message: “Object or Method not supported on line 34 blah blah blah…”
function savenew(){
document.formname.fieldname.value="add";
with(document.formname){
action="myaddnewpage.cfm"; // line 34...this is the bit the error is pointing to.
method="post";
submit();
}
}
What do you mean I can’t use action = someurl. I do it all the time!!! ARGGGGG. But then I found an obscure bit of documentation that claims you can not use the action object if you have it as an object named “action” later in the document. Well, lo and behold I have a database column called action so I simply named the corresponding form element “action” . Renamed it to “f_action” and it works just fine.
<select name="f_action">...
But since I didn’t want to go update all the functions throughout the tool where that might occur I merely omitted the action and method statement in my function and used the form tag attributes for the action url and method.