Mailchimp add subscriber to all groups - mailchimp

I've been trying to find some information on how to do this and I'm beginning to think that it is impossible. I'd like some input from others before I give up the idea completely.
I have dropdown select on my form that allows the user to select which group they want to sign up for.
<select name="group[3893]" class="form-control" id="mce-group[3893]">
<option value="">What would you like to hear about?</option>
<option value="1">Zumba</option>
<option value="2">Pilates</option>
<option value="">All Classes</option>
</select>
I have no idea what value to assign to the All Classes option. Is it possible to sign the user up to both groups?
I think that the only way around this is to create a third group called All Classes and subscribe them to that.

There are two approaches that will work, and which one is best depends on your use case. The differentiating point is what happens to someone who chooses "all classes" when a new type of class is offered? Let's say John subscribes and clicks "all classes". A few months later you add barre classes to your selection. Should John receive those emails?
If so: you'll want to create an "all classes" group. This is how MailChimp themselves handle this.
If not: you'd probably want to use javascript to make selecting "all classes" check all of the interest groups before the form submission.

Related

jQuery Select2 - Search Data Attributes for Additional Search Terms

I am trying to see if there is a way to have Select2 search a data-attr as well as the value instead of the option text alone.
For example - state drop menu has state abbreviations. Easy to search "ND" and the select menu filters to ND. However if the user types in Dakota in the search field, then both ND and SD would appear. In some cases, the search terms may be multiple items like "North America" or "Mid West" and the states tagged that can also appear.
<select id="state">
<option data-search-term="North Dakota, Mid West, Region 1" value="ND">ND</option>
<option data-search-term="South Dakota, Mid West" value="SD">SD</option>
</select>
This example is very simple and I am not using a states drop menu, just easier to explain it this way. Any feed back would be greatly appreciated. I tried working with the matcher aspect shown but couldn't figure it out. https://select2.org/searching

Laravel how to create a validation rule to allow only a certain value to be chosen based on previous choice

I'm working on a reduxForm in Laravel and have created some rules in my Request file. Most of them are pretty simple but there is one specific rule I need to add and I don't quite know how.
There is a toggle switch, and then later in the form there is a dropdown with a list of choices. What I need to do is to make sure that if the aforementioned toggle switch is set to ON, only allow a certain value to be chosen in the dropdown.
<SelectBox layout="inline" {...user_role}>
<option value={ null }>-- Please select --</option>
<option value="1">Role 1</option>
<option value="2">Role 2</option>
</SelectBox>
This is the select box. If the toggle switch is on, the form should only submit when Role 2 is chosen. If the toggle switch is off, then either role can be chosen.
So far, the rule is as follows:
'user_role' => 'required'
which is fine, as it is required, but I need to expand it to basically say 'It can only be Role 2 if this toggle is True'
Is there a way to do this?
Thank you

How to select value in dropdown menu in ruby watir without knowing the value?

I'm trying to select something from a dropdown menu, without knowing what are the options. The code needs to work for many users and everyone has different values.
<select name="aspx_accountinformation_accountstatementsearch_ascxTRANSACTION_HISTORY1dfe5e76-b83a-4957-84c3-16e8ae795e9c$ddlAccount" id="aspx_accountinformation_accountstatementsearch_ascxTRANSACTION_HISTORY1dfe5e76-b83a-4957-84c3-16e8ae795e9c_ddlAccount" class="selectM">
<option value="Selectare">Selectare</option>
<option value="226523531-Card">226523531-232-MDL</option>
</select>
For now I was only found how to do it knowing the options, like this:
browser.option(:text,'226523531-232-MDL').click
I am not sure whether I understood your question correctly,
If you want to select the first option all the time, then
locator='aspx_accountinformation_accountstatementsearch_ascxTRANSACTION_HISTORY1dfe5e76-b83a-4957-84c3-16e8ae795e9c$ddlAccount'
b.select_list(name: locator).options.first.select
If you want to select some random option, then
b.select_list(name: locator).options.to_a.sample.select

Dynamic list for MailChimp checkboxes

I have a newsletter sign up form on my website that presents the user with a list of checkboxes to select. The checkboxes are generated dynamically from my database. Other standards newsletter sign up fields, such as email, name, phone number, address, etc. exist in the sign up form, as well.
In MailChimp, I have created a List and have added custom fields to match my sign up form (e.g. phone number, address). I then looked at the Embedded Forms -> Naked to see the generated markup. It's easy enough to set the name attributes of the text fields on my sign up form to match those in MailChimp's.
The struggle for me now is the checkboxes. I cannot put the list of items for the checkboxes in MailChimp as they need to be dynamically generated from my database. I have added a checkbox field in MailChimp to see what name attribute it generates in hopes I could use it in my form; I see something like this:
<input id="mce-group[15757]-15757-0" name="group[15757][1]" type="checkbox" value="1">
In my sign up form, I tried something like this:
<input name="group[15757][]" type="checkbox" value="Apple">
When I signed up, "Apple" was not carried over.
How do I capture checkbox items from my signup form into MailChimp?
It looks like you're using interests -- you won't be able to pass custom values to those, as they are simply yes or no. You'd probably be better off using a merge field. Alternately, you can create the interests dynamically, but you'll need to write a script to do that, you won't be able to use the form builder directly.

populating a text box on a form - oracle

I am using application builder in oracle - and I have a create new record form for the opening times of a cinema.
Basically at the moment I have it so you can put ina cinema id from a cinema table, but the problem is whith that you need to know the id - so its not very user friendly. I would like this id to be dynamically be put in to the form somehow by slecting the cinema name from a dropdown (I have managed to include the cinema dropdown)
How can i populate the form with the respective id based upn the choice of the select box in application builder?
Thanks
Do you mean Oracle Application Express, which has a component called application builder?
A typical select list query would be:
select cinema_name, cinema_id
from cinemas
order by cinema_name;
That will display a list of cinema names to the user, and when the pick one populate the item value with the cinema ID. In HTML terms it constructs a SELECT tag like this:
<select id="P1_CINEMAS">
<option value="11">Ashtead</option>
<option value="23">Birmingham</option>
<option value="72">Croydon</option>
</select>
If the user chooses "Croydon" from the above list, the value "72" will be posted to the database.

Resources