Fetch a node based on a form text filed value before form submit Umbraco 8
Form has a accountNumber field, when entered, looks for a node with same Account Number under Account Number Details node in content section and grabs the address and email under it r. Below is my code. Account number hardcoded, it works. Doesnt work as Account Number entered in textbox is not being recognized. I tried using HttpContext.Current.Request["acountNum-req"] but no luck.
Need help.
@{
string deliveryList = "";
string addressList = "";
string accNum = "1000909";
((((((I need to get accNum from a text input field instead of hardcoded value))))))
var accountDetailsNode = Model.AncestorOrSelf("Root").Children
.Where(x => x.Name == "Account Numbers Details")
.FirstOrDefault();
if (accountDetailsNode != null)
{
var accountNumberNodes = accountDetailsNode.Children("accountNumber");
if (accountNumberNodes.Any())
{
foreach (var accountNumberNode in accountNumberNodes)
{
var accountNumber = accountNumberNode.Name;
if (accountNumber == accNum)
{
var jubiliantAddresses = accountNumberNode.Children("jubiliantDeliveryAddress");
foreach (var jubiliant in jubiliantAddresses)
{
// Handle jubiliantEmail which might be a collection
var emails = jubiliant.Value<>
Fetch a node based on a form text filed value before form submit Umbraco 8
Form has a accountNumber field, when entered, looks for a node with same Account Number under Account Number Details node in content section and grabs the address and email under it r. Below is my code. Account number hardcoded, it works. Doesnt work as Account Number entered in textbox is not being recognized. I tried using HttpContext.Current.Request["acountNum-req"] but no luck. Need help. @{ string deliveryList = ""; string addressList = ""; string accNum = "1000909";
((((((I need to get accNum from a text input field instead of hardcoded value))))))
var jubiliantAddresses = accountNumberNode.Children("jubiliantDeliveryAddress"); foreach (var jubiliant in jubiliantAddresses) { // Handle jubiliantEmail which might be a collection var emails = jubiliant.Value<>
}
is working on a reply...