Hello,
I searched the FAQ's and found a similar problem (thread216-7131253) but couldn't get it to work for me. I am trying to set the value of one hidden field ("optionsChanged" as part of a function that also stores the values of all the fields on the form in a cookie prior to opening a pop-up window. When I used the code from the aforementioned thread (basically, setting the value of the hidden field in a separate function) it threw the error that the object did not exist.
Here's the code that sets the value of the hidden field, stores the values from the form in an existing cookie, and opens the pop-up window. The creation of the cookie and the storing of data in the cookie works fine for ALL other fields, except the one being set in the Javascript.
The alert (currently commented out) displays the value as if it is set correctly, but that value is not stored in the cookie, although everything else is. ???
Thanks for your help.
/******************
open_window(p_href)
Open a popup window with the location of p_href. Store values of frmData in a cookie.
*******************/
function open_window(p_href)
{
var v_newwindow = '';
var v_element;
document.frmData.OptionsChanged.Value = "True";
//alert("Value = " + document.frmData.OptionsChanged.Value);
store_form_values(document.frmData);
if (!v_newwindow.closed && v_newwindow.location)
{
v_newwindow.location.href = p_href;
}
else
{
v_newwindow=window.open(p_href,'WinName',
'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, copyhistory=no, height=400, width=500');
if (!v_newwindow.opener) v_newwindow.opener = self;
}
}
/*******************************************************************************
store_form_values(p_form)
Store values of p_form in a cookie. Parameter p_form must be of type form
*******************************************************************************/
function store_form_values(p_form)
{
var v_element;
for (var i=0; i<p_form.elements.length; i++) {
if (p_form.elements.type == "text"
|| p_form.elements.type == "select-one"
|| p_form.elements.type == "hidden"
|| p_form.elements.type == "checkbox"
|| p_form.elements.type == "textarea" {
v_element = p_form.elements;
v_page_cookie[v_element.name] = v_element.value;
}
}
v_page_cookie.store();
}
I searched the FAQ's and found a similar problem (thread216-7131253) but couldn't get it to work for me. I am trying to set the value of one hidden field ("optionsChanged" as part of a function that also stores the values of all the fields on the form in a cookie prior to opening a pop-up window. When I used the code from the aforementioned thread (basically, setting the value of the hidden field in a separate function) it threw the error that the object did not exist.
Here's the code that sets the value of the hidden field, stores the values from the form in an existing cookie, and opens the pop-up window. The creation of the cookie and the storing of data in the cookie works fine for ALL other fields, except the one being set in the Javascript.
The alert (currently commented out) displays the value as if it is set correctly, but that value is not stored in the cookie, although everything else is. ???
Thanks for your help.
/******************
open_window(p_href)
Open a popup window with the location of p_href. Store values of frmData in a cookie.
*******************/
function open_window(p_href)
{
var v_newwindow = '';
var v_element;
document.frmData.OptionsChanged.Value = "True";
//alert("Value = " + document.frmData.OptionsChanged.Value);
store_form_values(document.frmData);
if (!v_newwindow.closed && v_newwindow.location)
{
v_newwindow.location.href = p_href;
}
else
{
v_newwindow=window.open(p_href,'WinName',
'toolbar=no, location=no, directories=no, status=yes, menubar=no, scrollbars=yes, copyhistory=no, height=400, width=500');
if (!v_newwindow.opener) v_newwindow.opener = self;
}
}
/*******************************************************************************
store_form_values(p_form)
Store values of p_form in a cookie. Parameter p_form must be of type form
*******************************************************************************/
function store_form_values(p_form)
{
var v_element;
for (var i=0; i<p_form.elements.length; i++) {
if (p_form.elements.type == "text"
|| p_form.elements.type == "select-one"
|| p_form.elements.type == "hidden"
|| p_form.elements.type == "checkbox"
|| p_form.elements.type == "textarea" {
v_element = p_form.elements;
v_page_cookie[v_element.name] = v_element.value;
}
}
v_page_cookie.store();
}