text box calculation

Questionstext box calculation
prasad asked 12 years ago

hi, im using ur premium version.

when we click on the + icon an add form popup will be open

in the add form(data insertion) say for example:
text box— 1—data entry value-25
text box —–2–data entry value-30
text box —–3–computed value
the above text box values should be added and should be displayed in textbox 3 as below without clicking any button
text box——3 -calculated value-55
and all above values should be inserted into database

1 Answers
Abu Ghufran answered 12 years ago

You can use onblur event and do your own JS code to set value.
You can also inspect the ID of elements of form using firebug.

$col = array();
$col["title"] = "text1";
$col["name"] = "text1";
$col["editable"] = true;
$col["editoptions"] = array("onblur" => "jQuery('#text3').val( parseInt(jQuery('#text1').val()) + parseInt(jQuery('#text2').val()))");
$cols[] = $col;

$col = array();
$col["title"] = "text2";
$col["name"] = "text2";
$col["editable"] = true;
$col["editoptions"] = array("onblur" => "jQuery('#text3').val( parseInt(jQuery('#text1').val()) + parseInt(jQuery('#text2').val()))");
$cols[] = $col;

Your Answer

5 + 1 =

Login with your Social Id:

OR, enter

Attach code here and paste link in question.
Attach screenshot here and paste link in question.



How useful was this discussion?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate it.

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?