You are viewing limited content. For full access, please sign in.

Question

Question

Forms Javascript for onload function

asked on August 11, 2016

Hi Guys,

 I need to do calculation using javascript. the formula for calculation will depend on a radio button ("Yes or No". As my form will be read only. I want to execute the function once  page is load.

 

Below is my screenshot of my javascript calculation

 

 

javascript.JPG
javascript.JPG (114.55 KB)
0 0

Replies

replied on August 11, 2016

Hi Jason,

Rather than using $(function() at the start of your script try wrapping it with this instead:

$(document).ready(function(){
// Your code here
});

I hope this helps!

Cheers, Dan

1 0
replied on August 11, 2016

Based on this post, your javascript has some errors. Functions declarations should not be declared in your if statement. The functions should be declared at the top right after your "$(function() {" clause.

1 0
You are not allowed to follow up in this post.

Sign in to reply to this post.