Buttons assign field values

i have a document that contains an approve button that has a javascript code below that assigns a value to a field “flag”. everytime i click on the approve button the value of the field flag does not changed to 2. what maybe the problem???

var form = document.forms[0]

form.flag.value=“2”;

form.submit();

self.close();

Subject: Buttons assign field values

Try this…

Assign an ID to the field, say “flagID”.

Now, your button:

That should set the field value… but as for the closing of the window…

There’s another approach I tend to use, which is to create a page which has it’s content type set to “text/html”:

Now, I use this page as my destination post-submission of a given form (via the $$Return, for example, or posted from my agent, etc.) I then pass querystring parameters to this page:

success.html?open&header=val1&onload=val2…

Using the @UrlQueryString function, I can get the values from the querystring and now make the page above completely dynamic. For example, I might use something like this:

@If(@UrlQueryString(“onload”) = “close”; “onload="window.close();"”;“”)

My $$Return would return this post-submission:

page.html?open&onload=close

This would then, (if placed on my second from the above example, allow me to dynamically control the flow of my application using querystrings generated from the application logic.

I have a few examples of this on my site… if you’re interested, I’ll go into further detail.

HTH,

-Chris

Chris Toohey

Subject: RE: Buttons assign field values

thanks for the info, i canot access your website. do you an email addy?

Subject: RE: Buttons assign field values

Can’t access my website?! That’s damn-near the scariest thing I’ve ever heard :wink:

Send me at email at ctoohey@dominoguru.com if you need to get in touch with me!

-Chris

http://ww.dominoguru.com