Go to a Form.
Add a new button in a form cell which does "execute javascript".
In that JS, I want to call a function, but I need the values of form fields.
having trouble with syntax.
cant use the usual suspects:
<<Cust.CustNum>>
{Cust.CustNum}
data["Cust.CustNum"]
tried var tag = parser.getField ("CustNum").getValue (); but "parser" is unknown. This is normally used in a Render script.
Plenty of examples for getting this in a Grid using the "parser" object.
Pretty sure I've done this before... just can't find it.
How do I get the value of FORM fields when executing Javascript from a Button?
How do I get the value of FORM fields when executing Javascript from a Button?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
Re: How do I get the value of FORM fields when executing Javascript from a Button?
I often use jQuery for things like that. To do this in Aware, set an ID for the input (myformfield) and then use this script:
Code: Select all
var myformfield = $('#myformfield').val();
Henrik (V8 Developer Ed. - Windows)
Re: How do I get the value of FORM fields when executing Javascript from a Button?
I thought this was going to work, but there is no place for me to enter a cell id.
I am on a form.
the form has a child reference field "om_images"
the images are in a custom layout
there are right-click operations defined in "operations with records" - this creates a pop-up menu on right-click on PC and also works nicely on tablet.
one of those operations uses "Execute Javascript" where I want to call a script and I need access to fields in that BO's instance.
"parser" is unknown, i assumed because I wasn't in a traditional grid.
But i guess I'm not in a traditional form either.
@Support surely should know how?
I am on a form.
the form has a child reference field "om_images"
the images are in a custom layout
there are right-click operations defined in "operations with records" - this creates a pop-up menu on right-click on PC and also works nicely on tablet.
one of those operations uses "Execute Javascript" where I want to call a script and I need access to fields in that BO's instance.
"parser" is unknown, i assumed because I wasn't in a traditional grid.
But i guess I'm not in a traditional form either.
@Support surely should know how?
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL
-
- Posts: 297
- Joined: Wed Apr 22, 2015 11:44 pm
Re: How do I get the value of FORM fields when executing Javascript from a Button?
Was there ever been an answer for this?
Re: How do I get the value of FORM fields when executing Javascript from a Button?
Jim, I don’t think I got a specific answer.
I think I just changed what I was doing, but it was so long ago, I can barely think of which app this was about.
But it depends on if you’re trying to get access to a field on a form or in a grid, because the syntax is different.
Perhaps you might need to start a new post with your exact situation.
I think I just changed what I was doing, but it was so long ago, I can barely think of which app this was about.
But it depends on if you’re trying to get access to a field on a form or in a grid, because the syntax is different.
Perhaps you might need to start a new post with your exact situation.
Click Here to see a collection of my tips & hacks on this forum. Or search for "JaymerTip" in the search bar at the top.
Jaymer
Aware Programming & Consulting - Tampa FL
Jaymer
Aware Programming & Consulting - Tampa FL