I have this code
var array, key, dc;
$.post("/mailchimp/check_mailchimp_key",
{
store_id: document.getElementsByName('data[store_id]')[0].value,
mailchimp_api_key: document.getElementsByName('data[mailchimp_api_key]')[0].value,
array: mailchimp_api_key.split('-'),
key: array[0],
dc: array[1]
}
store_id and mailchimp_api_key work, but I have problem with others. This way it says mailchimp_api_key is not defined and my goal is to take whatever is stored in mailchimp_api_key and divide it to key and dc.