I have a form where a pop-up on submit confirmation box appears, and wondering how do I include dynamic data from the server connect. I tried {{dynamic_field_name}}, but that didn’t work.
<form is="dmx-serverconnect-form" id="sc_frm_booking_del" method="post" action="../dmxConnect/api/orders/test" onsubmit="return confirm('Are you sure you want to cancel your Order#{{__INSERT_DYNAMIC_ORDER_NUMBER}}?');">
<form is="dmx-serverconnect-form" id="sc_frm_booking_del" method="post" action="../dmxConnect/api/orders/test" onsubmit="return confirm('Are you sure you want to cancel your Order#' + __INSERT_DYNAMIC_ORDER_NUMBER + '?')">
No need for double curly brackets… Just close the single quotes before the dynamic value and use + to add the dynamic value.
*Are you sure that “__INSERT_DYNAMIC_ORDER_NUMBER” contains your value?
What kind of element is this? Is this an input, a query field or what? Where is that coming from?
Its just from a dynamic picker from a server connect for example {{ordpck_pck_name }} but I can’t incorporate it in this onsubmit="return confirm… because is non-wappler code
Your case is confusing me because you submit a form and ask for a confirmation "sure you want to cancel your order?). And you want to pass a subquery field of your serverconnect as an identifier
I have to understand what you are trying to do my friend
Ye that is correct, I am trying to include a subquery field from the server connect and I have a form inside the repeat.
I tried your suggestion and it returns the same first record for each record display.
I have read in a previous post from you and I think that you have a custom query, right?
Custom queries return always an array of records even if it returns only 1 record.
So, I suppose you have to use $index
serverConnect[$index].ordpck_pck_name (or something like that)
Adding the following gives me undefined:. Do I have the ( + ’ all correct? Not sure if I wrapped in the code properly??
onsubmit="return confirm('Are you sure you want to remove '+ dmx.parse('sc_orddetail.data.repeat[0].query_pckages[$index].ordpck_pck_name') +' from your Booking?');"