/    Sign up×
Community /Pin to ProfileBookmark

Button callback

I am making a dynamic javascript dialog and the user has the ability to add buttons through the toggleModal method. I also want to be able to assign call backs for the buttons. So right now I have:

[code]
onclick=”toggleModal(‘A title’,’Are you sure you want to click these buttons?’,’Yes,No,Maybe’);”
[/code]

That makes my dialog, gives it a title of ‘A title’, the message is ‘Are you sure you want to click these buttons?’, and you can create however many buttons you like in the last param (I split at the comma and then run a loop to create the buttons).

Now the only way I can think of doing this is something like adding the function name after the buttons like this.. and I dont even know if that will work

[code]
onclick=”toggleModal(‘A title’,’Are you sure you want to click these buttons?’,’Yes,No,Maybe’,’function1,function2,function3′);”
[/code]

What would you guys suggest?

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @rondog 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 5.22,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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