Note that there are some explanatory texts on larger screens.

plurals
  1. POjquery ui buttons show and hide in dialog box
    primarykey
    data
    text
    <p>I have appended to my dialog box 3 buttons and inside of my dialog box I have 3 tabs and I would like show and hide the buttons in function of the clicked tab</p> <p>the code for dialog looks as it follows </p> <pre><code> $('a.open_dialog_edit').click(function(e) { //e.preventDefault(); var tabsDiv=$('&lt;div /&gt;').appendTo('body').load($(this).attr('href'),function(){ //$('#tabs').tabs(); var editor = $('.textarea').wysihtml5().data("wysihtml5").editor.setValue(getCustomText($('select#state').val(), $('input#contactname.required').val())); var dialog = $('#tabs').tabs( { select: function(ev, ui) { //Setup Buttons to each Tab switch(ui.index) { case 0: $('.ui-dialog-buttonpane').find("button:contains('Email Senden')").hide(); break; case 1: $('.ui-dialog-buttonpane').find("button:contains('Speichern')").hide(); break; } } }).dialog({ title: $(this).attr('title'), modal: true, draggable: false, width: 800, position: 'top', buttons: [{ text: "Speichern", "class": "btn btn-primary", click: function () { $.ajax({ type: "POST", url: 'action.php', data: $("#edit_form").serialize(), // serializes the form's elements. success: function(data) { alert('Der Datensatz wurde gespeichert!'); // show response from the php script. }, error:function(){ alert('Es gibt ein Fehler bei Daten übetragung!'); } }); }, }, { text: "Email Senden", "class": "btn btn-primary", click: function () { $.ajax({ type: "POST", url: 'mailer.php', data: $("#contactform").serialize(), // serializes the form's elements. success: function(data) { alert('Das Email wurde geschickt!'); // show response from the php script. }, error:function(){ alert('Es gibt ein Fehler bei Daten übetragung!'); } }); }, text: "Rechnung herunterladen", "class": "btn btn-primary", click: function() { $.ajax({ type: "POST", url: 'docsx.php', data: $("#edit_form").serialize(), // serializes the form's elements. success: function(data) { window.location.href ='rechnung.docx'; // show response from the php script. }, error:function(){ alert('Es gibt ein Fehler bei Daten übetragung!'); } }); } }], close: function() { tabsDiv.remove() // so I can reload again location.reload(true); // allFields.val( "" ).removeClass( "ui-state-error" ); }, }); $('select#state').on('change',function() { $('ul.wysihtml5-toolbar').remove(); alert($('select#state').val()); $('.textarea').wysihtml5().data("wysihtml5").editor.setValue(getCustomText($('select#state').val(), $('input#contactname.required').val())); }); }); return false; }); </code></pre> <p>an example would be: if the first tab is clicked than sen Email button should be hided</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload