Fix: The default select choice was not selected when using jquery dialog
confirm boxes.
This commit is contained in:
parent
6a97a45111
commit
2d000b5df8
@ -2231,6 +2231,9 @@ class Form
|
|||||||
$inputok=array();
|
$inputok=array();
|
||||||
$inputko=array();
|
$inputko=array();
|
||||||
|
|
||||||
|
// Clean parameters
|
||||||
|
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
|
||||||
|
|
||||||
if (is_array($formquestion) && ! empty($formquestion))
|
if (is_array($formquestion) && ! empty($formquestion))
|
||||||
{
|
{
|
||||||
$more.='<table class="paddingrightonly" width="100%">'."\n";
|
$more.='<table class="paddingrightonly" width="100%">'."\n";
|
||||||
@ -2337,7 +2340,15 @@ class Form
|
|||||||
$formconfirm.='
|
$formconfirm.='
|
||||||
$(function() {
|
$(function() {
|
||||||
$( "#'.$dialogconfirm.'" ).dialog({
|
$( "#'.$dialogconfirm.'" ).dialog({
|
||||||
autoOpen: '.($autoOpen ? "true" : "false").',
|
autoOpen: '.($autoOpen ? "true" : "false").',';
|
||||||
|
if ($newselectedchoice == 'no')
|
||||||
|
{
|
||||||
|
$formconfirm.='
|
||||||
|
open: function() {
|
||||||
|
$(this).parent().find("button.ui-button:eq(1)").focus();
|
||||||
|
},';
|
||||||
|
}
|
||||||
|
$formconfirm.='
|
||||||
resizable: false,
|
resizable: false,
|
||||||
height: "'.$height.'",
|
height: "'.$height.'",
|
||||||
width: "'.$width.'",
|
width: "'.$width.'",
|
||||||
@ -2383,11 +2394,12 @@ class Form
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
var button = "'.$button.'";
|
var button = "'.$button.'";
|
||||||
if (button.length > 0) {
|
if (button.length > 0) {
|
||||||
$( "#" + button ).click(function() {
|
$( "#" + button ).click(function() {
|
||||||
$("#'.$dialogconfirm.'").dialog("open");
|
$("#'.$dialogconfirm.'").dialog("open");
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
@ -2417,7 +2429,6 @@ class Form
|
|||||||
$formconfirm.= '<tr class="valid">';
|
$formconfirm.= '<tr class="valid">';
|
||||||
$formconfirm.= '<td class="valid">'.$question.'</td>';
|
$formconfirm.= '<td class="valid">'.$question.'</td>';
|
||||||
$formconfirm.= '<td class="valid">';
|
$formconfirm.= '<td class="valid">';
|
||||||
$newselectedchoice=empty($selectedchoice)?"no":$selectedchoice;
|
|
||||||
$formconfirm.= $this->selectyesno("confirm",$newselectedchoice);
|
$formconfirm.= $this->selectyesno("confirm",$newselectedchoice);
|
||||||
$formconfirm.= '</td>';
|
$formconfirm.= '</td>';
|
||||||
$formconfirm.= '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Validate").'"></td>';
|
$formconfirm.= '<td class="valid" align="center"><input class="button" type="submit" value="'.$langs->trans("Validate").'"></td>';
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user