fields putting
Copy link to clipboard
Copied
Hello,
I have another situation that I am unable to figure out by myself. The form I have has three different areas. What I would like to have it do is, when I put a dollar amount in the first area, "transfer amt 1" have it put 79 into "text1". The same with the others but different numbers, "transfer amt 2" would have 80 appear in "text1" and then "transfer amt 3" would have 87 appear in "text1". I hope you understand what I am trying to say. If this helps, there will not be amounts in all three areas at the same time. Only one will be used. Here is a screen shot.
Thank you in advance for your help!
Justin
Copy link to clipboard
Copied
This is almost identical to your other question. Use the code I provided there.
Copy link to clipboard
Copied
I thought I would be able to do it myself using that code from yesterday (I did try). However, the spot I have a hard time with is, when I right click on "transfer amt 1" (properties - options) what I get is different than yesterday with the radio buttons. here is a screen clip.
this where I am at a loss again. Sorry to keep bothering you with these issues but until I learn more in depth details, I have to resort to using this forum.
Thank you again for all your help.
Justin
Copy link to clipboard
Copied
It's exactly the same... The script needs to go under the Calculate tab, "Custom calculation script" option.
Copy link to clipboard
Copied
Hello,
I am just not understanding and I feel really dumb over it. Maybe if I just start over?
This time I have been asked to remove the radio buttons "group1", so they are no longer part of the form.
The request that I was given is, when someone puts an amount into "transfer amt 1", a 79 will appear in "text1". Same idea with "transfer amt 2", an 80 will appear in "text1" and then finally "transfer amt 3", an 87 will appear in "text1".
To make things even more confusing... I was just asked if it could be made to where when someone enters data in "transfer amt 1", that they are not able to put any data in any of the other two areas where "transfer amt 2" and "transfer amt 3" are.
Now, yesterday, when the radio buttons were the issue, I right clicked on the radio button and property-options, I put in the specific number for that radio button, 79 for example. When I do the same for "transfer amt 1", I do not get the same as on the radio button. there is no radio button choice.
When I look at your formula, I see it saying "group1". There is no "group1" now. Do I replace that with "transfer amt 1"? If I do, then where would I put "79" so it is associated with that "transfer amt 1".
Thank you so munch for your patience with me. I want to understand what you are trying to show me but it just isn't sinking in.
Copy link to clipboard
Copied
Ah, I misunderstood your request, then. I thought it was the other way around.
Also, I think your description of how it should work makes things more difficult then they should be.
Why not simply use three radio-buttons (for "transfer amt1", 2 and 3) and one text field? That's a much simpler and more elegant solution, and will require a much less complex code to implement.
Copy link to clipboard
Copied
Sadly, I have no control on the layout of the form. However...what if we got rid of the whole idea of
"To make things even more confusing... I was just asked if it could be made to where when someone enters data in "transfer amt 1", that they are not able to put any data in any of the other two areas where "transfer amt 2" and "transfer amt 3" are".
What if we just had it where, someone types whatever in "transfer amt 1" and then a 79 appears in "text1" and the same idea for the other two areas when you write something in them. Does that simplify things?
Copy link to clipboard
Copied
What should happen if they fill in more than one field, though?
Copy link to clipboard
Copied
I feel that they would be happy with it just working where they put any information in "transfer amt 1" and the number "79" would appear below. And the same for the two boxes to the right. They are already set up to perform their calculations in each "section" if you will.
Now that I think about it.... is there a "if / then" formula that could be used on just the "transfer amt 1,2,3" that would say, If information is placed in "transfer amt 1, then 2 and 3 would be blank"? is that an "easier" way? Then have whatever value is put on that top line "transfer amt 1" a 79 would appear below. I am just thinking of things...
Either way would be fine.
Thank you again for all of this help. I am planning on keeping the formulas you use so I can pick them apart and try to understand them better so I can possibly utilize them on my own someday.
Thanks,
Justin
Copy link to clipboard
Copied
Yes, you can do it all using a custom validation script. For example, for "transfer amt 1" it would be something like this:
if (event.value) {
this.getField("transfer amt 2").value = "";
this.getField("transfer amt 3").value = "";
this.getField("text1").value = "79";
}
Copy link to clipboard
Copied
I must be doing something incorrect. I copied and pasted the script in the calculation script area for "transfer amt 1". when I put a value in that field, 79 does not appear in the box below. I know I am asking for a lot with all this but could you break down the steps a little bit more?
Copy link to clipboard
Copied
The value will only update when you exit the field. Also, you should open the JS Console (Ctrl+J) and see if there are any error messages there.
Copy link to clipboard
Copied
Here is what I have in for "transfer amt 1"
When using that Ctrl+J, here is what comes up.
This is quite the maddening process....Not you by any means you have been absolutely fantastic and have been very patient with me and my ignorance in this scripting process.
Copy link to clipboard
Copied
That means there's no field with that name. Double-check you spelled it correctly, including lower/upper-case letters.
Copy link to clipboard
Copied
Worked like a charm, I found upper case and lower case issues. Fixed and working.
Could you please please help with just a couple more items???
When you put in an amount into the first block "transfer amt", then you say it should have been in block two instead, so you enter in an amount in "Transfer Amt" in that second block, the amount from the first block goes away like we wanted (screen shot 1).
However, when you put an amount in "Transfer Amt" in block three, then everything clears in the first two blocks, which is awesome. How do we get that to happen all the way around? Just like we did for the top lines? I did try using the formula that you gave for the transfer amounts and I couldn't get it to work correctly or actually not at all...
This should be the end of this form. I certainly hope so for myself and I am pretty sure for you too.
Copy link to clipboard
Copied
I only provided the script for the first field. To use it in the other fields you just need to adjust the fields names which it resets and the value which you want to appear in the "text1" field, and that's it.
Or am I not understanding your question correctly?
Copy link to clipboard
Copied
I don't need anything in the "text1" when a value is in the Transfer Fees area. the line about that will take care of that part. I just want to clear that field when someone enters info into another section or block or group. Would I just get rid of the line of script that mentions putting something in the text field because the first line "transfer amount" will trigger the number to go in the bottom.
I think I am starting to confuse myself
Copy link to clipboard
Copied
Sorry, I'm not really following you... If you don't want "text1" to have a value (at least not one based on the input in the other fields) then just remove those lines from the code.
Copy link to clipboard
Copied
"transfer amt 1" is the one we did earlier, it puts that number in "text1". That part is great!
What they are asking now is that all the data be removed when someone goes and inputs info into another "block or section".
Scenario:
Someone puts data in the first section under "Domestic (US), they put an amount in Transfer amount and transfer fees and it adds up and is displayed in total paid. then they realize that that was the incorrect place to put it. It should have been in the area all they way to the right under "int'l - Foreign $". When they go to type in the dollar amounts in those fields, it would remove what was typed in the "Domestic (US) area.
Does that make sense?
Here is what I tried using based on what we used for "transfer amt 1" and the other two areas, this is what I had put into "fees1"
if (event.value) {
this.getField("fees2").value = "";
this.getField("fees3").value = "";
}
Copy link to clipboard
Copied
Seems fine. It's not working?
Copy link to clipboard
Copied
Hey man,
hope the weekend was good for you.
I couldn't get it to work on how I think they want it.
Like before, when an amount is put in the Transfer amount areas, it bring that number down below, totally awesome. How ever what we are now looking for is when even some on puts amounts in one of the sections or blocks, lets say that group called Domestic (US), an amount in transfer amt and then an amount in transfer fees, it will add up and be put in total paid. then they realize that is not the area the data should have been put into. when the start to put info into another section like "Int'l - Foreign, all the numbers under the other block that was in error would be cleared out. With that one example we would really want whatever section is being filled out, it is clearing any data that could be in the other two "blocks/sections". I hope that makes some sense to you. It's hard for me to break it down.
Copy link to clipboard
Copied
So you want to clear the values of the other fields as well, not just the transfer amt fields? Then just add additional lines to the code that clear them, in the same structure as the ones you already have, only with different field names.
Copy link to clipboard
Copied
That seemed to have done the trick!
I can't thank you enough for your knowledge and most importantly your patience with me. If I have any more question on the same form, I will reach out by replying to this message and thread.
Copy link to clipboard
Copied
Hello,
It is me again....
It seems there is another area where the amounts that are inserted into the top areas are also calculated at the bottom of the form. Can we somehow link that up or insert something into the formulas already to remove the amounts in these other fields at the same time? I tried to add something to the formula but all it did remove the amounts from appearing when they should be appearing. I am putting in a screen shot. I hope it helps to explain what I am trying to do and relay.
Copy link to clipboard
Copied
Hello,
It is me again....
It seems there is another area where the amounts that are inserted into the top areas are also calculated at the bottom of the form. Can we somehow link that up or insert something into the formulas already to remove the amounts in these other fields at the same time? I tried to add something to the formula but all it did remove the amounts from appearing when they should be appearing. I am putting in a screen shot. I hope it helps to explain what I am trying to do and relay.
-
- 1
- 2