NEW Add focus when editing on product/stock/product.php Close #14548
This commit is contained in:
parent
829ef1ae0b
commit
fe4acf4e4e
@ -199,12 +199,12 @@ class Form
|
||||
if (preg_match('/^(string|safehtmlstring|email)/', $typeofdata))
|
||||
{
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($editvalue ? $editvalue : $value).'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||
} elseif (preg_match('/^(numeric|amount)/', $typeofdata))
|
||||
{
|
||||
$tmp = explode(':', $typeofdata);
|
||||
$valuetoshow = price2num($editvalue ? $editvalue : $value);
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').'>';
|
||||
$ret .= '<input type="text" id="'.$htmlname.'" name="'.$htmlname.'" value="'.($valuetoshow != '' ?price($valuetoshow) : '').'"'.($tmp[1] ? ' size="'.$tmp[1].'"' : '').' autofocus>';
|
||||
} elseif (preg_match('/^text/', $typeofdata) || preg_match('/^note/', $typeofdata)) // if wysiwyg is enabled $typeofdata = 'ckeditor'
|
||||
{
|
||||
$tmp = explode(':', $typeofdata);
|
||||
@ -217,7 +217,7 @@ class Form
|
||||
}
|
||||
|
||||
$valuetoshow = ($editvalue ? $editvalue : $value);
|
||||
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'">';
|
||||
$ret .= '<textarea id="'.$htmlname.'" name="'.$htmlname.'" wrap="soft" rows="'.($tmp[1] ? $tmp[1] : '20').'"'.($cols ? ' cols="'.$cols.'"' : 'class="quatrevingtpercent"').$morealt.'" autofocus>';
|
||||
// textarea convert automatically entities chars into simple chars.
|
||||
// So we convert & into & so a string like 'a < <b>b</b><br>é<br><script>alert('X');<script>' stay a correct html and is not converted by textarea component when wysiwig is off.
|
||||
$valuetoshow = str_replace('&', '&', $valuetoshow);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user