...

View Full Version : onchange for Firefox



USDArch
04-08-2009, 02:24 AM
My current experience is on a CA application and dont have much experience on Javascriopt coding but am in a situation to use Javascripting. I have the below script in one of my web pages.

function Emp()
{
if (event.propertyName.toLowerCase() !="value" ||
event.srcElement.value.length ==0)
return;
if (document.main_form.elements['SET.category'].value == "somevalue")
{
document.main_form.elements['SET.summary'].value = "Do not enter any information here";
document.main_form.elements['SET.description'].value = "Do not enter any information here.";
}
}

Somewhere later in the web page I check for a condition and on tru have the following statement.

document.main_form.elements['SET.category'].onpropertychange=EmpProbCat;

This works fine on IE but I want this to implement this on Firefox. I understand onpropertychange is IE only but am not making much progress by using onchange or onblur. Could you please help?

Thanks

Kor
04-08-2009, 03:25 PM
Can you post the HTMl as well? What kind of element is 'SET.category' ?

USDArch
04-08-2009, 08:06 PM
This is not a HTML page but HTMPL. I am attaching the code below. Not sure if it will make sense.

<SCRIPT LANGUAGE="JavaScript">
function EmpProbCat()
{
if (event.propertyName.toLowerCase() !="value" || event.srcElement.value.length ==0)
return;

if (document.main_form.elements['SET.category'].value == "pcat:400219" || document.main_form.elements['SET.category'].value == "pcat:400220" || document.main_form.elements['SET.category'].value == "pcat:400221" || document.main_form.elements['SET.category'].value == "pcat:400222" || document.main_form.elements['SET.category'].value == "pcat:400223" || document.main_form.elements['SET.category'].value == "pcat:400224")
{
document.main_form.elements['SET.summary'].value = "Third Party Certificate Request";
document.main_form.elements['SET.description'].value = "Do not enter any information here\n\n**Please Note: Do not use this form for password reset requests. In order to request a password reset for a user, please use the 'Application Support.Third Party Certificates Issues' category.";
}
}
<PDM_IF "$prop.form_name_3" == "ro">
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlDate hdr="Open Date/Time" attr="open_date">
<PDM_MACRO NAME=dtlReadonly hdr=Status attr="status">
<PDM_MACRO NAME=dtlReadonly hdr=Priority attr="priority">
<PDM_MACRO NAME=dtlReadonly hdr="Request Area" attr="category">
</PDM_IF>

<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr=Summary attr="summary" size=60 colspan=4 keeplinks=yes spellchk=yes>
<PDM_MACRO NAME=dtlDate hdr="Need by" attr="call_back_date" size=20>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlTextbox hdr="Request Description" attr="description" size=100 colspan=4 rows=6 keeplinks=yes spellchk=yes make_required=yes>
<PDM_MACRO NAME=dtlStartRow>
<PDM_MACRO NAME=dtlEndTable>
<PDM_IF "$prop.form_name_3" == "edit">
document.main_form.elements['SET.category'].onpropertychange=EmpProbCat;
</PDM_IF>

</SCRIPT>

Kor
04-09-2009, 10:20 AM
Whichever template applications or server includes you may have used, the result is an HTML or XHTML document. HTMPL is the name of the template application and sets of scripts, but, in the end, HTMPL generates a HTML document, and this is to be seen by the user, so that this is important when we try to debug HTML, CSS or javascript codes.

In other words, show us the document as you see it when you use View -> Page Source (in FF) or View -> Source (in IE) from the browser's toolbar.

USDArch
04-09-2009, 10:46 PM
Ah!
I have attached the source from the page where I am working on.
Let me know if this helps.

Thanks Kor.

USDArch
04-13-2009, 09:03 PM
Could someone please advise?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum