View Full Version : Java Script Multiplication With CRM 30

11-02-2006, 10:15 PM
I need to script out some multiplication, but am having an issue, and cant seem to figure out why this is not working.

var sqrnow = (crmForm.all.new_esc_squarefeet.DataValue);
if (isNaN(sqrnow))
alert(' not a number');
var results = (3 * sqrnow);
crmForm.all.new_esc_squarefeet.DataValue = results;

Basically what i want to do is take the crmForm.all.new_esc_squarefeet.DataValue and multiply it by 3 then put that number into crmForm.all.new_esc_lightingrecpsqftx3w.DataValue

this isnt working for me... Any help would be appreciated.

Thanks in advance

11-02-2006, 11:06 PM
what is : crmForm.all.new_esc_squarefeet.DataValue

what is the document type of your file? html, xml, ect....?

that does not look familiar to me.

could you post you whole source code please....

11-03-2006, 12:22 AM
is a NVARCHAR value on a Microsoft CRM Form, So If I wanted to change a value of one field to another on the form I would do it like this

crmForm.all.new_field.DataValue = crmForm.all.new_field2.DataValue

and thats all I would have to write.

If I wanted to say run a script that changed a field based on values I would write something like this

var sqrnow = (crmForm.all.nsi_squarefootage.DataValue);
if (isNaN(sqrnow))
alert(' not a number');
else if(sqrnow<2000)
else if(sqrnow>=2000 && sqrnow<5000)
else if(sqrnow>=5000)

I hope this helps you help me with multiplying my fields


11-03-2006, 12:32 AM
lol, i dont do drm forms. that would explain why it doesnt lok familiar to me.
all i can do is to suggst throwing in alerts. like alert the value of your var right after you set it. ect....

is it just not working or is it causing errors?