/    Sign up×
Community /Pin to ProfileBookmark

I need to impliment this code in wpforms

I am newbie and I have a small problem, I have below jQuery code and I need to add this code with a checkbox above submit button in wpforms with text so once user checks box and press submit button it should redirect to a url in new window without disturbing submission of form and form should be submitted with all details on same page.
If unchecked submission should work normally. Or if it can be achieved by any other code will be highly appreciated as well.

$(‘#button’).click(function(e){
e.preventDefault();
window.open(url,’_blank’);
$(‘form’).submit();
return false;
}

Any help would be highly appreciated.

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@kamialiauthorMar 20.2020 — Hi, Can anyone please help?

×

Success!

Help @kamiali spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...