diff --git a/htdocs/lib/lib_head.js b/htdocs/lib/lib_head.js index 863bb79ffaa00dbe668de4140faa4dba9d8fa281..f2cbb8bdd5e28c5bfa572599b35571c5e47c9edb 100644 --- a/htdocs/lib/lib_head.js +++ b/htdocs/lib/lib_head.js @@ -8,10 +8,10 @@ // \version $Revision$ -function dolibarr_type_reload(param) +function dolibarr_type_reload(param,formAction,elementName) { - document.formsoc.action.value="create"; - document.formsoc.private.value=param; + document.formsoc.action.value=formAction; + document.formsoc.elementName.value=param; document.formsoc.cleartype.value=1; document.formsoc.submit(); } diff --git a/htdocs/soc.php b/htdocs/soc.php index 3a0350e5ce529e8524185d3391e6eddb185d2c69..03700e035db7080cb9ecc7c5e476afdb59986dbd 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -297,11 +297,11 @@ if ($_POST["getcustomercode"] || $_POST["getsuppliercode"] || print "<br>\n"; print $langs->trans("ThirdPartyType").': '; print '<input type="radio" class="flat" name="private" value="0"'.(! $_REQUEST["private"]?' checked="true"':''); - print 'onclick="dolibarr_type_reload(0)"'; + print 'onclick="dolibarr_type_reload(0,\'create\',\'private\')"'; print '> '.$langs->trans("Company/Fundation"); print ' '; print '<input type="radio" class="flat" name="private" value="1"'.(! $_REQUEST["private"]?'':' checked="true"'); - print 'onclick="dolibarr_type_reload(1)"'; + print 'onclick="dolibarr_type_reload(1,\'create\',\'private\')"'; print '> '.$langs->trans("Individual"); print ' ('.$langs->trans("ToCreateContactWithSameName").')'; print "<br>\n";