Click to See Complete Forum and Search --> : Javascript is not working


FVillarejo
02-10-2003, 07:07 AM
Hi All.
I am trying to pass values from one document to another one. So I created a frame to able to pass the value.
The problem is that Javascript runs without error messages but the field "criticidad" is still empty. We have added alert to see the value and they are correct, but field "criticidad" continues empty.

Do you have any idea?

function getCriticidad(){
if (parent.frames.length >1)
{
parent.frames["ResultFrame"].document.forms[0].criticidad.value=
parent.frames["QueryFrame"].document.forms[0].criticidad.value;
alert(parent.frames["QueryFrame"].document.forms[0].criticidad.value);
alert(parent.frames["ResultFrame"].document.forms[0].criticidad.value);

}
}

Any help would be appreciate.

pyro
02-10-2003, 07:23 AM
Try this syntax...

top.ResultFrame.document.formname.criticidad.value = top.QueryFrame.document.formname.criticidad.value;

and change formname to the name of your form.

FVillarejo
02-10-2003, 08:45 AM
Hi

I am receiving the following message:

top.ResultFrame.document.criticidad has no properties.


thatīs the code:

function getCriticidad(){

{
top.ResultFrame.document.criticidad.criticidad.value = top.QueryFrame.document.search.criticidad.value

}
}

Thanks

FVillarejo
02-10-2003, 08:52 AM
Hi

I am receiving the following message:

top.ResultFrame.document.criticidad has no properties.


thatīs the code:

function getCriticidad(){

{
top.ResultFrame.document.criticidad.criticidad.value = top.QueryFrame.document.search.criticidad.value

}
}

Thanks

khalidali63
02-10-2003, 09:40 AM
This error may be caused because an element/object is not referenced properly.

Post your code here.

cheers

Khalid

FVillarejo
02-10-2003, 10:49 AM
Hi khalid,

This is the code I am using:

function getCriticidad(){

{
top.ResultFrame.document.$$SearchTemplateDefault.criticidad.value = top.QueryFrame.document.search.criticidad.value

}
}


This is the error message:

top.ResultFrame.document.$$SearchTemplateDefault has no
properties.



In fact, the field "criticidad" exists in the fornname above indicated.

pyro
02-10-2003, 11:41 AM
Why do you have two $$? If you are trying to insert a PHP variable, it should only be one $. Plus, where you have $$SearchTemplateDefault needs to be the name of the form that has criticidad in it. Is it?

FVillarejo
02-11-2003, 03:22 AM
Hi ,

I have realized that the original Javascript is working fine if I am opening the document in edit mode. So I would like to add to the Javascript, if it is possible, the function of edit at the begining of the JS, and save at the end of it.

Do you have any idea about doing it?

Thanks in advance

Fernando.