Hi all.
I am trying to find what is wrong with this javascript function.
Is somebody can help me? (Where is Pit??)
function OnAddUser()
{
var form = document.forms[0];
var cmd = ”;
var index = form.selectUser.selectedIndex;
if (!def(form.textUser) || !def(form.passwordUser) ||
!def(form.radioPriv[0]))
{
if (index > 0)
{
cmd += ‘no username’ + userArray[index-1].name + ‘[configure]’;
}
cmd += ‘username $textUser’;
if (form.radioPriv[1].checked)
cmd += ‘ privilege 15’;
else
cmd += ‘ privilege 1’;
if (isBlank(form.passwordUser.value))
{
cmd += ‘ nopassword’;
}
else
{
cmd += ‘ password 0 ‘;
cmd += form.passwordUser.value;
}
cmd +='[configure]’;
}
if (!isBlank(cmd))
{
cmd += ‘write memory quiet’;
clearHidden();
form.htmlSubmit.value = ‘true’;
locationCookie.location = ‘LocalUserList’;
locationCookie.store();
form.action = encode(cmd)’
form.submit();
}
}
why the statement “form.submit();” is not working?
what is the purpose of the ‘def’ function?
Thank you all
David