Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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

  • #2
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    Can you post the HTMl as well? What kind of element is 'SET.category' ?
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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>

  • #4
    Kor
    Kor is offline
    Red Devil Mod Kor's Avatar
    Join Date
    Apr 2003
    Location
    Bucharest, ROMANIA
    Posts
    8,478
    Thanks
    58
    Thanked 379 Times in 375 Posts
    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
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

  • #5
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah!
    I have attached the source from the page where I am working on.
    Let me know if this helps.

    Thanks Kor.
    Attached Files Attached Files

  • #6
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Could someone please advise?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •