HighDots Forums  

Javascript forms

Macromedia Dreamweaver Macromedia Dreamweaver Discussions (macromedia.dreamweaver)


Discuss Javascript forms in the Macromedia Dreamweaver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
GalbadianTech
 
Posts: n/a

Default 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();
}


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.