Web submit : all editable fields empty (CONFUSED)

This is drving me mad…

A new response document created on the web (usual method using parentunid in the url, etc.).

6 fields on the form, 2 of which are inherited from the parent. Click on the submit button which contains Javascript validation followed by a submit() call and I get the Form processed confirmation (will sort that out later)…

BUT look at the saved form in the client and all editable fields are blank, inherited/computed ones are completed correctly…

What on earth would cause this? As far as I can work out the form is set up correctly, just editable fields (with values being entered in the browser) are being saved as empty strings. ODD.

Any advice or suggestions would really help.

Thanks.

Subject: Web submit : all editable fields empty (CONFUSED)

Helen, I am having almost exactly the same issue. When I submit through a javascript call, all the code is being executed properly, but the changes are not being saved.

my previous post: http://www-10.lotus.com/ldd/nd6forum.nsf/DateAllThreadedweb/efd81e3532d9d926852572f200638a92?OpenDocument

If you but a loop in your form processed like:

Print “


Forall item In mydoc.Items

REM item.Values returns an array of values in the item

	Print item.Name & { = "} & item.Text & {"<br>}

End Forall

Print "<hr>"

You can see the values on response. You could do this your $$Return in formula language.

Subject: RE: Web submit : all editable fields empty (CONFUSED)

Lets hope we can get this solved - its driving me potty!

I put your code in the WQS and sent the responses to the admin console and all I got was:

FIELD1 = “”

FIELD2 = “”

WHY ARE THE EDITED VALUES NOT SAVING?!?

Subject: Web submit : all editable fields empty (CONFUSED)

I would check to see that you aren’t using = in your js validation when you should be using ==

Subject: RE: Web submit : all editable fields empty (CONFUSED)

One of the first things I checked… Nope, that’s not it.

Subject: (further info) Fields are keeping their default values, ignoring any updates

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:

  1. 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.

  1. 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.

Subject: RE: re: Fields are keeping their default values, ignoring any updates

To both of you: the proper way to create a Domino submit button when “use JavaScript to generate pages” is enabled is to create a Formula button that does @Command([FileSave]);@Command([FileCloseWindow]). If you need to run JavaScript on submit, use the onsubmit event of the form to call the code – the onsubmit event return will be evaluated by Domino’s _doClick() function. In addition to submitting the document to the server, _doClick() adds a value to the hidden __Click field that indicates to DOmino what action it is supposed to perform (save, refresh, run an agent, etc.).

I have posted methods to determine what JS to run in the onsubmit when there is more than one possible branch on this forum a number of times – the “what I’m doing is too complicated” excuse simply doesn’t fly.

Nicholaus, you’ve already proven to yourself that coding a Domino-friendly action works – why not use it?

Subject: RE: re: Fields are keeping their default values, ignoring any updates

Stan,

Thanks for your suggestions - I gave it a go and move the validation code to the onsubmit event, changed the submit button code to:

@if(@command[filesave]);@command([fileclose]);@return(“”))

… AND …

No dice. Still the values are only the default. I am so puzzled by this - what on earth would stop new field values from being saved??!

Subject: RE: re: Fields are keeping their default values, ignoring any updates

Don’t use the conditional save & close on the web – just @Command([FileSave]);@Command([FileCloseWindow]). Domino can’t interpret the @Return(“”) (or, alternatively, the “”) part of the action when you use it on the web, so the @If(…) action you’d use in the client won’t work on the web. The submit happens as you’d expect, but the save action doesn’t.

Subject: RE: re: Fields are keeping their default values, ignoring any updates

OK - I’ve amended the code as suggested and still no dice!

  • watching on the server console, with no errors…

I’m now taking coffee by drip-feed and developing a nervous twitch!

Subject: RE: re: Fields are keeping their default values, ignoring any updates

I found this thread in searching. 2.5 years later, did you ever solve the issue? I’m running into a very similar issue.

Subject: RE: re: Fields are keeping their default values, ignoring any updates

How similar? What are you doing, and what’s happening? Which browser(s) are you testing with, and so on, and so on?

Subject: RE: re: Fields are keeping their default values, ignoring any updates

Hmmmm. Can you send me a minimal copy of the db to take a look at (stan dot rogers at gmail dot com)?

Subject: RE: re: Fields are keeping their default values, ignoring any updates

Thanks for the info Stan. I think I’ll probably just go with the way that works. The onsubmit event won’t work for me because I need to popup a dynamic input area and let the user enter some text, then continue when they’re ready.

BTW, I really like your Open Web Calendar.

Subject: RE: re: Fields are keeping their default values, ignoring any updates

<<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 using an action button with javascript code which calls a validation routine and then .submit(); should fields have the correct values… Nothing as fancy as you’re doing!

Subject: RE: re: Fields are keeping their default values, ignoring any updates

I would recommend that you check the page source and look at what the javascript is actually doing. By default domino web forms have an action=“”. So, if your javascript just calls submit(). It’s not really gonna do anything because a form.submit() specifies “do whatever is in the action property”.

Subject: RE: re: Fields are keeping their default values, ignoring any updates

I just figured out the solution to a similar problem (fields that where being updated with JavaScript weren’t being saved with the document).

On the Domino form I was submitting there was a pass-through HTML

I’m working on updating an old application and it took me a while to find the problem. Once I removed that HTML, the document.submit() started saving everything.

Mark Crosby

Smitix Services Ltd.

http://www.smitix.com