Reputation: 439
I need to change the form action URL depending on the body class of the page. So far I have
$('document').ready(function () {
if ($('body').hasClass('hosting')) {
$('#quoteForm').attr('action', 'hostingURL');
}
});
and that works perfectly. But I need to expand it to include more body classes. I tried
$('document').ready(function () {
if ($('body').hasClass('hosting')) {
$('#quoteForm').attr('action', 'hostingURL');
}
elseif ($('body').hasClass('workspace')) {
$('#quoteForm').attr('action', 'workspaceURL');
}
else{}
});
but it isn't working. Any suggestions appreciated.
Upvotes: 8
Views: 20328