Go Back   CodingForums.com > :: Client side development > JavaScript programming > DOM and JSON scripting

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-08-2009, 01:24 AM   PM User | #1
USDArch
New to the CF scene

 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
USDArch is an unknown quantity at this point
onchange for Firefox

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
USDArch is offline   Reply With Quote
Old 04-08-2009, 02:25 PM   PM User | #2
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
Can you post the HTMl as well? What kind of element is 'SET.category' ?
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 04-08-2009, 07:06 PM   PM User | #3
USDArch
New to the CF scene

 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
USDArch is an unknown quantity at this point
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>
USDArch is offline   Reply With Quote
Old 04-09-2009, 09:20 AM   PM User | #4
Kor
Red Devil Mod


 
Kor's Avatar
 
Join Date: Apr 2003
Location: Bucharest, ROMANIA
Posts: 8,478
Thanks: 58
Thanked 379 Times in 375 Posts
Kor has a spectacular aura aboutKor has a spectacular aura about
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.
__________________
KOR
Offshore programming
-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
Kor is offline   Reply With Quote
Old 04-09-2009, 09:46 PM   PM User | #5
USDArch
New to the CF scene

 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
USDArch is an unknown quantity at this point
Ah!
I have attached the source from the page where I am working on.
Let me know if this helps.

Thanks Kor.
Attached Files
File Type: txt source.txt (27.7 KB, 107 views)
USDArch is offline   Reply With Quote
Old 04-13-2009, 08:03 PM   PM User | #6
USDArch
New to the CF scene

 
Join Date: Apr 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
USDArch is an unknown quantity at this point
Could someone please advise?
USDArch is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 05:26 AM.


Advertisement
Log in to turn off these ads.