- solid6designAsked on October 07, 2011 at 01:58 PM
Is there a way I can pre populate a text box with a value of 2 other textboxes?
How much did you spend today: $5
How much did you spend yesterday: $4
Total: $9 <--adding the two entrys together
If you look at the link where I am using the form, I want to be able to autofill the "Total commitment" for the user before sending
- yasincoAnswered on October 07, 2011 at 02:01 PM
This is a very good question but i'm not sure if it is possible, a jotform support rep will help you soon and I will also look into to this.
I hope this helps.
- yasincoAnswered on October 07, 2011 at 02:03 PM
Have looked into it and its not available, sorry. For more information please go to the following thread:
- JotForm SupportabajanAnswered on October 07, 2011 at 03:03 PM
Having looked at the form in question, judging form the third field's sub-label, what you actually want is for that field to display the total of the other fields multiplied by 2. Is that not correct?
- JotForm SupportabajanAnswered on October 07, 2011 at 11:15 PM
Okay, here's the solution:
Follow these instructions and remove the currency symbols from the hint examples of the three fields in question because if a user were to enter (say) "1000.00" in the What I normally give in a year field and "5000.00" in the My expanded generosity for "I Will...", "12000.00" would be automatically inserted into the My two year "I Will..." commitment field, on focus. However, if the user were to enter "$1000.00" and "$5000.00" respectively, the third field would just have "NaN" (Not a Number - an error).
Please let us know if this solution meets your need.
- JotForm SupportabajanAnswered on October 08, 2011 at 05:50 PM
I was later to discover that in order for this solution to work correctly in Internet Explorer 8 (and possibly some other browsers) the hint examples will need to be replaced with hover texts or the currency symbol removed from the hints. Otherwise, the form will load with "NaN" in the third field. Since the form in question is rather narrow, the hover texts will have to be repositioned and their arrows moved. Please see this clone of your form that you may in turn clone to view its injected CSS.
- solid6designAnswered on October 11, 2011 at 10:25 PM
Yeah Dude, this works! Thanks a bunch!
- solid6designAnswered on October 11, 2011 at 10:41 PM
For the future searchers.. Once I cloned the form, I did have to change the Form ID in the function
a = document.form_12832746805.q1_whatI.value
b = document.form_12832746805.q3_myExpanded.value
and re add the:onfocus="totalx2();"
on the input code for field 4.
Thanks again for the help!
- JotForm SupportabajanAnswered on October 12, 2011 at 02:39 AM
Quite true. I forgot to mention that. Anyway, glad to help.