Forum OpenACS Q&A: Re: setting __refreshing_p to 1?

Collapse
Posted by Jerry Asher on
I am working on a page who's author uses __refreshing_p.

What they have is a li'l piece of javascript attached to the form element

{html {on change "document.info_form.__refreshing_p.value='1'; document.info_form.refresh_p.value='1';document.info_form.submit()"}}
They also have a hidden form element refresh_p
{refresh_p:text(hidden) {label "Refresh"} {value 0}}
They check refresh_p in validate blocks. If it's set they "excuse" blocks that don't validate.

In the -on_refresh block, they set the values of those calculated widgets values that uh, make sense to refresh. At the end of the form, they call

template::element set_value info_form refresh_p 0
Collapse
Posted by James Thornton on
Rather than using refresh_p, why not simply make use of __refreshing_p...

} -validate {

{sku {$__refreshing_p || 0 < [string length [string trim $sku]]} "\"SKU\" must contain a value"}

}