How do I pass a current form field value to new popup?
I have a sales entry form where the user selects a boolean, "Has a trade?". When the form is submitted, my code displays a popup form tied to a separate datasource. The "Parent Stock No" field on this popup needs to come from the "Stock No" field on the initial sales entry form. I'm not having any success passing it forward.
I tried to modify my Submit/OnClick script to set the (source)Stock No field as a variable and then set the popup's field after making it visible, but that doesn't seem to work.
//Submit button, 'On Click' code.
app.closeDialog('AddSaleWindow');
var tradechk = widget.datasource.item.HasTrade;
if(tradechk === true){
app.popups.AddTradePopup.visible = true;
}
widget.datasource.createItem();
edit w/ working code - Used on a "Submit and add another" button. It passes a stock number and deal type to the second form.
var parentStkNo = app.popups.AddTradePopup.children.ParentStkNo.value;
var parentDealType =
app.popups.AddTradePopup.children.TradeDealType.value;
widget.datasource.createItem();
app.popups.AddTradePopup.visible = false;
app.closeDialog('AddSaleWindow');
app.popups.AddTrade2Popup.visible = true;
app.popups.AddTrade2Popup.children.ParentStkNo.value = parentStkNo;
app.popups.AddTrade2Popup.TradeDealType.value = parentDealType;
google-app-maker
add a comment |
I have a sales entry form where the user selects a boolean, "Has a trade?". When the form is submitted, my code displays a popup form tied to a separate datasource. The "Parent Stock No" field on this popup needs to come from the "Stock No" field on the initial sales entry form. I'm not having any success passing it forward.
I tried to modify my Submit/OnClick script to set the (source)Stock No field as a variable and then set the popup's field after making it visible, but that doesn't seem to work.
//Submit button, 'On Click' code.
app.closeDialog('AddSaleWindow');
var tradechk = widget.datasource.item.HasTrade;
if(tradechk === true){
app.popups.AddTradePopup.visible = true;
}
widget.datasource.createItem();
edit w/ working code - Used on a "Submit and add another" button. It passes a stock number and deal type to the second form.
var parentStkNo = app.popups.AddTradePopup.children.ParentStkNo.value;
var parentDealType =
app.popups.AddTradePopup.children.TradeDealType.value;
widget.datasource.createItem();
app.popups.AddTradePopup.visible = false;
app.closeDialog('AddSaleWindow');
app.popups.AddTrade2Popup.visible = true;
app.popups.AddTrade2Popup.children.ParentStkNo.value = parentStkNo;
app.popups.AddTrade2Popup.TradeDealType.value = parentDealType;
google-app-maker
1
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46
add a comment |
I have a sales entry form where the user selects a boolean, "Has a trade?". When the form is submitted, my code displays a popup form tied to a separate datasource. The "Parent Stock No" field on this popup needs to come from the "Stock No" field on the initial sales entry form. I'm not having any success passing it forward.
I tried to modify my Submit/OnClick script to set the (source)Stock No field as a variable and then set the popup's field after making it visible, but that doesn't seem to work.
//Submit button, 'On Click' code.
app.closeDialog('AddSaleWindow');
var tradechk = widget.datasource.item.HasTrade;
if(tradechk === true){
app.popups.AddTradePopup.visible = true;
}
widget.datasource.createItem();
edit w/ working code - Used on a "Submit and add another" button. It passes a stock number and deal type to the second form.
var parentStkNo = app.popups.AddTradePopup.children.ParentStkNo.value;
var parentDealType =
app.popups.AddTradePopup.children.TradeDealType.value;
widget.datasource.createItem();
app.popups.AddTradePopup.visible = false;
app.closeDialog('AddSaleWindow');
app.popups.AddTrade2Popup.visible = true;
app.popups.AddTrade2Popup.children.ParentStkNo.value = parentStkNo;
app.popups.AddTrade2Popup.TradeDealType.value = parentDealType;
google-app-maker
I have a sales entry form where the user selects a boolean, "Has a trade?". When the form is submitted, my code displays a popup form tied to a separate datasource. The "Parent Stock No" field on this popup needs to come from the "Stock No" field on the initial sales entry form. I'm not having any success passing it forward.
I tried to modify my Submit/OnClick script to set the (source)Stock No field as a variable and then set the popup's field after making it visible, but that doesn't seem to work.
//Submit button, 'On Click' code.
app.closeDialog('AddSaleWindow');
var tradechk = widget.datasource.item.HasTrade;
if(tradechk === true){
app.popups.AddTradePopup.visible = true;
}
widget.datasource.createItem();
edit w/ working code - Used on a "Submit and add another" button. It passes a stock number and deal type to the second form.
var parentStkNo = app.popups.AddTradePopup.children.ParentStkNo.value;
var parentDealType =
app.popups.AddTradePopup.children.TradeDealType.value;
widget.datasource.createItem();
app.popups.AddTradePopup.visible = false;
app.closeDialog('AddSaleWindow');
app.popups.AddTrade2Popup.visible = true;
app.popups.AddTrade2Popup.children.ParentStkNo.value = parentStkNo;
app.popups.AddTrade2Popup.TradeDealType.value = parentDealType;
google-app-maker
google-app-maker
edited Jan 4 at 20:45
Matt Watson
asked Jan 2 at 19:00


Matt WatsonMatt Watson
32
32
1
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46
add a comment |
1
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46
1
1
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011765%2fhow-do-i-pass-a-current-form-field-value-to-new-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54011765%2fhow-do-i-pass-a-current-form-field-value-to-new-popup%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
The piece of code you included in your question does not appear to have your modified code where you are trying to pass your Stock No as a variable. Could you please include the modified code even if it doesn't work?
– Markus Malessa
Jan 2 at 20:12
Sorry for the delay - I solved my problem! Edited the OP with new code that works - let me know if there was a more efficient way to go about it.
– Matt Watson
Jan 4 at 20:46