none
OnChange Event Question RRS feed

  • 问题

  • Hello...
    I have 3 fileds, let's say...

    Status <picklist - Referred, Rejected, Pending, Matched, Employed>
    Employed <bit - No, Yest>
    Related Profession <bit - No, Yes>

    if (Employed == "yes" && RelatedProfession == "yes")
        then Statuse == "Employed"

    How to implement in Javascript?


    I have another Filed, Qualified <bit - No, Yes>

    var qValue = crmForm.all.ses_qualified.DataValue;
    if (qValue = 0){                                                  // no
        crmForm.all.ses_clientstatus.DataValue = 7;     // rejected             
    }
    else if (qValue = 1){                                           // yes
        crmForm.all.ses_clientstatus.DataValue = 8;     // pending
    }

    but the output is always Status=Pending

    Please help me work it out...... Thank you!

    2009年6月9日 22:17

答案

  • if (qValue == 0){                                                  // no
        crmForm.all.ses_clientstatus.DataValue = 7;     // rejected             
    }
    else if (qValue == 1){                                           // yes
        crmForm.all.ses_clientstatus.DataValue = 8;     // pending
    }
    equal (==)應該是兩個等於號吧
    韓建興 http://jamson.cnblogs.com
    2009年6月10日 8:47

全部回复

  • if (qValue == 0){                                                  // no
        crmForm.all.ses_clientstatus.DataValue = 7;     // rejected             
    }
    else if (qValue == 1){                                           // yes
        crmForm.all.ses_clientstatus.DataValue = 8;     // pending
    }
    equal (==)應該是兩個等於號吧
    韓建興 http://jamson.cnblogs.com
    2009年6月10日 8:47
  • Thank you Han.
    It works as you suggested.


    For the first part of question ....
    Status <picklist - Referred/6, Rejected/7, Pending/8, Matched/9, Employed/10>
    Employed <bit - No/0, Yes/1>
    Related Profession <bit - No/0, Yes/1>

    if (Employed == "yes" && RelatedProfession == "yes")
        then Statuse == "Employed"

    my solutions is ....

    var mValue = crmForm.all.ses_employed.DataValue;
    var rpValue = crmForm.all.ses_relatedprofession.DataValue;

    if (mValue = 1){
        if (rpValue = 1){
            crmForm.all.ses_clientstatus.DataValue = 10;
        }
    }

    I didn't use "==", but it works.
    Here comes my another question....
    "==" means EQUAL, then what dose "=" mean?
    when should I use "==" and when "="?

    Thanks again.

     


    2009年6月11日 16:39