Javascript forms -
01-05-2006
, 10:13 AM
I have a page with a form in a repeat region, this form has two buttons an edit
and a delete depending on which you choose the action of the form will change
ex: below
the only problem is all the forms are named the same do to the repeat region
so you have to use document.forms[number] where "number" represents the number
of the form on the page ex: form[0] is the first form on the page form[1] is
the second and so on . I can't figure out how to tell javascript which form
number your trying to submit any ideas? it has to be set in the onclick action
of the button to post the form "number" to the function.
Brandon Kozak
function prompt_delete(i)
{
var agree = confirm("Note All Deletions Are Final. Do You Still Want To
Process The Delete?")
if(agree)
{
document.forms[number].action = "delete2.php";
document.forms[number].submit();
}
}
function edit(i)
{
document.forms[number].action = "index.php?cid=Clients&action=edit_final";
document.forms[number].submit();
} |