I have an edit button that should prompt a user (using javascript) if fieldA = update required. The confirm should present the user with OK/Cancel. If cancel is hit, nothing should happen. If the user hits OK, it should use javascript to launch my agent updatenow. Thoughts? Thanks team…
Subject: Javascript Confirm() & Condition
does this help?
if (confirm(“Are you sure that all of the information that you entered is correct?”))
{
if(form.New.value == "")
{
form.Action.value = "Create";
}
else
{
form.Action.value = "Save";
}
checkFieldsSubmit();
}
Subject: RE: Javascript Confirm() & Condition
Thanks… sounds good. I’m assuming that this will not work if the New field is “”. How about if the button calls a function in the JS Header with button called runagent? Example…
function statuscheck() {
var changestatus = document.forms[0].status.value ==“update now”
if (changestatus){
if confirm (“Do you want to change the status now?”)
document.forms[0].runagent.click()
else
return true;
}
else{
return false;
}
}
Something does not seem right… am certain my syntax is off. When the user clicks the buitton, it should start by making sure the field = (example) “Update now”. If it = update now, the confirm box should appear. If user clicks OK, the agent should be triggered. If cancel, it should just stop. I guess a JS print with URL and agent parameter would have been better.
Subject: RE: Javascript Confirm() & Condition
you are not calling the agent correctly
you call an agent the same way you call a page or a form
OpenAgent
Syntax:
http://Host/Database/AgentName?OpenAgent
Example:
http://www.acme.com/sales/leads.nsf/Process+New+Leads?OpenAgent
Note: Agents may only be referred to by name. The use of UNID is not supported when referring to an agent.
Subject: RE: Javascript Confirm() & Condition
Thanks… will try this with the JS print.