Subject: re: Fields are keeping their default values, ignoring any updates
Helen,This is exactly the same issue I’m having. What is your call to the submit() function of the form look like? What is the URL you are placing in the form.action property?
I’m doing
form.action = “http://database/view/documentID?SaveDocument”
and trying to place my agent in the WebQuerySave.
This causes a post back, but does not update any of the fields on the document, nor does it seem to run the agent. However, if I use an action hotspot with the command @Command([FileSave]); @Command([CloseWindow]), this actual creates a button which works.
The hitch is, I need to run my javascript before doing this.
I think there are two options here:
- Place the hotspot on the web form and give it an HTML property of style=“display:none;” & id=“somename”. Then in your javascript function make a call like this:
var foo = document.getElementById(‘somename’).onclick();
this will run your javascript then call the domino generated function when you’re ready for it.
I tried this and it did work. I just think it’s pretty ugly coding and am trying to find a better and more reusable piece of code.
- Depending on how javascript processes event triggering. We may be able to use the action hotspot generated by domino, but append our own custom functions to the event handler. It would be something like:
document.getElementById(‘dominosaveaction’).attachEvent(‘onclick’, myfunction);
then hope the order off events is: click the button->myfunction->dominoaction.
Also, and this is probably the best way come to think of it. If we attach the action to the form.onsubmit event, we can run our actions then use the event.returnValue property to decide if we want to allow the submit to actually happen.
I think that’s the best idea. I’m going to try and then I’ll post to let you know if it works.