I have a form where I changed Content type to HTML (I want to do some serious DOM scripting and don’t want to do pass-through).
Opening an existing document with “/?EditDocument” works fine - I can change values and with my HTML and my button the changes are saved.
(Doing that I learned that unless you have actual Notes fields on your HTML form somehwere that match the name= of your HTML fields, the values will be ignored)
Now I want to compse a new document - it is a response. I’d like to do this in an HTML view of the parent docs - click on one and it opens a new response.
Having an HTML form eliminates using the URL Command “?OpenForm” - gets me Error 500: Documents treated as HTML cannot be edited.
Using “?ReadForm” works OK - the form comes up. When I use action=“?SaveDocument” with it though, I get Error 404: Couldn’t find design note because that needs to be done as “/?SaveDocument”. If I trap using HTTP_Referer and build that format, I get Entry not found in index - only works on existing docs.
When I use “?ReadForm” to create a new document what I have to use is “?CreateDocument”. When I try that though I get an Error 500: Invalid UNID. Because I have no valid $Ref for my form that is set to Response to Response? That’s my best guess. So I pass the UNID of the parent document in the Query String, “?ReadForm&ParentUNID=”, and save it in a field on the new document. I can’t use this value to directly set $Ref though, because it comes out as type text instead of type response, and the new document is an orphan.
So then I guess in WebQuerySave I should run a LotusScript agent that uses ParentUNID from the Query String to find the parent and call MakeResponse. Which gets me an Error 500: Invalid URL Exception. And man it’s getting late.
Is there a simpler way to compose a new response doc with an HTML form? Or am I on the right track and should just soldier on?
I’ve been spending too much time at this - any help would be greatly appreciated. I’ve done extensive searching through this forum, but I can’t find anything about anyone creating a response doc with an HTML form and having any trouble like this - either nobody has tried or it must be much simpler than what I am getting myself into. Thanks.
Well my coworker stumbled on the solution. He was trying to show me something else and typed ?CreateDocument&ParentUNID= into the address bar thinking it would open up the form in the browser, but it gave a form processed message, and lo and behold a blank response doc was created attached to the !! So simple I could cry! The only place &ParentUNID is mentioned in Designer Help is on ?OpenForm, but you can’t use that with a form where you’ve set the content type to HTML.
PLEASE mention in Designer Help that &ParentUNID is also an optional argument for ?CreateDocument!!!
So to save anyone else the hours of stupid useless digging around that I went through, if you want to have a functional HTML form you can use to create response docs, it goes like this:
Subject: some things I learned when DOM scripting for Internet Explorer…
Here are a few gotchas, I hope they save someone some time:
HTML box, check for Internet Explorer and hide the select box first (selectBox.style.display=“none;”).
Adding table rows dynamically: in any modern broswer, you get a handle on the
tag and you use appendChild to add a new tableRow. In Internet Explorer this gets no result.
Solution: apparently there is this
tag that does nothing but allow Internet Explorer to add table content. When you get your handle on your
tag, check for Internet Explorer and grab your tag instead (you’ll have to put one in if you want to add a row to an existing table) - after that everything works the same. Found that buried in here:
Hiding
table rows: in any modern browser you hide a table row with tableRow.style.display=“none;” and you show it with tableRow.style.display=“table-row;”. In Internet Explorer, the hiding works fine - but it barfs all over the showing part. Internet Explorer does not understand the table-row display style.
Solution: to show a table row, check for Internet Explorer and set the display style to blank instead: tableRow.style.display=“”. Found that buried in here:
Subject: RE: some things I learned when DOM scripting for Internet Explorer…
Just one thing, Mark – is not as useless as you make it out to be. It’s a semantic tag that you should always be using. It indicates that you are in the data body of the table, as opposed to the and , which are considered labels. While it may not make a lot of difference to users who can read the table directly on screen, it can make a difference for people who rely on screen readers. Be nice – use it.