Dialog Modal-form solution/suggestion/workaround needed
Hi folks,
I am able to use this dialog modal-form when i want to have only one button per page. But, in my directory site, i want to be able to have multiple buttons (belonging to a company listed, if it has email in my database).
The problem exists when i open a page with 10 items (let's say 7 of them have email in DB and thus have buttons attached "Contact us via email").
Only the first button from the top is working and styled correctly. The rest of them are displayed with no style and have no functionality whatsoever.
I suspect it might be so due to:
- $( "#create-user" )
- .button()
- .click(function() {
- $( "#dialog-form" ).dialog( "open" );
- }
Since all of them have id="create-user" the scipt probably is not aware it should give the ability to ALL of them to call the dialog, not only the first one found (the 1st from the top).
There's a screenshot PNG attached so take a look please.
My opinion is that this can be solved by hardcoding #create-user2, #create-user3,etc.
and then also marking all subsequent IDs of my items in the same fashion.
But, i feel there might be a more ellegant solution to this?
I'll be glad to hear and try any suggestions!