I have an embed in my safecracker form. Embed has a select box and can select a name of a Tea.
I want to send name of the Tea with safecracker URL to next page.
This is the code:
{exp:safecracker channel="blending_log" return="sthome/blending/ENTRY_ID" dynamic_title=" [selected_tea]_[organic_or_conventional][date_time][agent_number]"}
<h3>Select and enter data</h3>
{embed="stembeds/.blending_select_tea"}
{!--------Receive data to create value--------}
<input type="hidden" name="title" value="" />
<br /><br />
Organic Or Conventional:
{field:org_con}
Agent Number:
{field:agent_number}
{!-----END Receive data to create lot number-------}
The embed is: {embed="stembeds/.blending_select_tea"}
This is the code in embed:
<select name="selected_tea">
<option selected="selected" >Select a Tea</option>
{exp:channel:entries channel="tea_herbs" order_by="title" sort="asc"}
<option name={title} id={entry_id} value={url_title}>{title}</option>
{/exp:channel:entries}
</select>
I want to select tea from embed and I want to send the Tea name with safecracker URL:
{exp:safecracker channel="blending_log" dynamic_title="[selected_tea]_[organic_or_conventional][date_time][agent_number]" return="sthome/blending2_nimmi/ENTRY_ID"}
Please help me to solve this issue.
Thank you very much
Make sure you have a text field in your "blending_log" channel with the name "selected_tea" - otherwise SafeCracker won't save that value.
Your embed should look like this:
<select name="selected_tea">
<option value="" selected="selected">Select a Tea</option>
{exp:channel:entries channel="tea_herbs" order_by="title" sort="asc" dynamic="no" disable="member_data|pagination|categories"}
<option value="{url_title}">{title}</option>
{/exp:channel:entries}
</select>