Append textbox values to URL
Hello,
I am seeking assistance on a task to append a text box value to the URL as the field is being added to the textboxes. Example: Amt=Textbox1.value
url+Amt?=[value of Textbox1]
And this value would have to a keyup function.
Any assistance you can provide is greately appreciated.
Thank you,
Joe
I am seeking assistance on a task to append a text box value to the URL as the field is being added to the textboxes. Example: Amt=Textbox1.value
url+Amt?=[value of Textbox1]
And this value would have to a keyup function.
Any assistance you can provide is greately appreciated.
Thank you,
Joe
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Hi,
Here is a sample:
Replace TextField with the internal name of the field (you can find it in the field's properties in the designer).
Here is a sample:
Code: Select all
function buildUrl() {
var url = 'URL?' + fd.field('TextField').value();
// do something with the url
}
// on text change
fd.field('TextField').change(buildUrl);
// on init
buildUrl();
Thank you Dmitry,
This helps me get to my next element. I am trying to capture the value of the "Amount" field and place it on the URL param so when I open the child "New item" link, I will get the value from the url param and place it on the child form.
I know how to get the url keyvalue with the "fd.getUrlParam(sourceUrl, 'ParamName')" script, but first I need to place the value in the source URL so I can retrieve it.
Any assistance you can provide me is greatly appreciated.
Thank you,
Joe
This helps me get to my next element. I am trying to capture the value of the "Amount" field and place it on the URL param so when I open the child "New item" link, I will get the value from the url param and place it on the child form.
I know how to get the url keyvalue with the "fd.getUrlParam(sourceUrl, 'ParamName')" script, but first I need to place the value in the source URL so I can retrieve it.
Any assistance you can provide me is greatly appreciated.
Thank you,
Joe
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
I see. There is no need to place a parameter into URL to pass it into a child window. If you open a child form in a dialogue, you can retrieve a parent's field value this way:
Code: Select all
window.top.fd.field('FieldName').value()
Thank you Dmitry,
I know you said I can use this script
"window.top.fd.field('FieldName').value()"
and it works well if I open from a NON Dialogue window, but if I am coming from an open dialogue I am getting "undefined". Is there another script syntax that I can use to read the fields from an open dialogue.
Almost there,
Joe
I know you said I can use this script
"window.top.fd.field('FieldName').value()"
and it works well if I open from a NON Dialogue window, but if I am coming from an open dialogue I am getting "undefined". Is there another script syntax that I can use to read the fields from an open dialogue.
Almost there,
Joe
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Do you mean that you open both parent and child forms in dialogues?
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
Not a good practce, but you can find the parent dialogue in the list of iframes of the parent window:
Test the code with various indices.
Code: Select all
window.top.frames[2].fd.field('FieldName').value()
Thank you Dmitry for your assistance.
I will not open the parent page in a dialog form. But in order for the form to flow in accordance to our process, is there a way I can redirect the user back to the previous page after submit?
That way I don't have to open up a dialog box to collect the fields I need.
Thank you again.
Joe
I will not open the parent page in a dialog form. But in order for the form to flow in accordance to our process, is there a way I can redirect the user back to the previous page after submit?
That way I don't have to open up a dialog box to collect the fields I need.
Thank you again.
Joe
- Dmitry Kozlov
- Site Admin
- Posts: 1524
- Joined: Thu Jun 07, 2012
This is how it works by default. The Source URL parameter contains a URL where a user will be redirected after saving or closing a form.
-
- Information
-
Who is online
Users browsing this forum: No registered users and 3 guests