locked
Javascript Newbie question RRS feed

  • Question

  • I have been able to do a number of things using Javascript, but here is something that has got me stumped. The answer is probably obvious, but I can't see it.

    to demonstrate: I've got a bit of script in the OnLoad event of the Account entity Form like this:

    alert(crmForm.all.name.DataValue);
    
    var client_name = crmForm.all.name.Datavalue;
    
    alert(client_name);
    

    The first alert works fine and displays the client name (as expected)

    The second alert doesn't work and says "undefined".

    I don't get it?

    Peter

    Thursday, January 27, 2011 12:32 AM

All replies

  • Your second line of code uses Datavalue, instead of DataValue; capital 'V'.

    Javascript is case sensitive, so you have to be very careful with your syntax.


    --pogo (pat)
    Thursday, January 27, 2011 12:57 AM
  • You have a lower case 'v' in DataValue where you set client_name. Javascript is case sensitive, so it should look like: -

    var client_name = crmForm.all.name.DataValue;
    alert(client_name);
    
    
    Neil


    Neil - My CRM Blog
    Thursday, January 27, 2011 12:58 AM
  • Argh..

    I know it's case sensitive and just couldn't see it.

    Thanks heaps for pointing it out, though..

    Peter

    Thursday, January 27, 2011 1:37 AM