// generation of a password
$password = $instance->RiseMacros("Random.Text", array( "10", "cd" ));
// find the field of 1st password
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("Passwd");
if ($he->IsVoid) {
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("Passwd");
}
if ($he->IsVoid) {
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:password", "fulltag", "input:password", "text", 0);
}
if ($he->IsVoid) return -1;
// set the 1st password
$he->SetValue($password, true);
// find the field of confirm password
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByName("PasswdAgain");
if ($he->IsVoid) {
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildById("PasswdAgain");
}
if ($he->IsVoid) {
$he = $instance->GetTabByAddress("page")->GetDocumentByAddress("0")->FindElementByTag("form", 0)->FindChildByAttribute("input:password", "fulltag", "input:password", "text", 1);
}
if ($he->IsVoid) return -1;
// set the confirm password
$he->SetValue($password, true);