...

View Full Version : onclick



kev wood
06-10-2008, 10:21 AM
would it be possible to create another form inside the other one and set the target to self so it does not open a new window when the button is clicked. would the function be able to be duplicated or would the not work. if my code was like this would it work?


<input name="preview" type="image" value="preview" onclick="changeAction(0)" src="admin/images/preview_btn.gif" alt="Preiview your Layout" align="left" />
<br />
<br />
<input align="left" name="send2" type="image" src="admin/images/test_btn.gif" alt="Send mailout" />
<br />
<br />

<input align="left" name="send" type="image" onclick="changeAction(1)" src="admin/images/list_btn.gif" alt="Send mailout" />
<br />
<br />
<form id="button" method="post" enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" target="_blank">
<input name="reset" type="image" onclick="broad.php" src="admin/images/reset_btn.gif" />
</form>

function changeAction(ins)
{var form1 = document.getElementById('buttons');
if(ins==0)
form1.action = "broad_prev.php";
if(ins==1)
form1.action = "broad_send.php";
form1.submit();
}

the above code for the change action would be for all the other button and this one below would be for the button which has been put in its own form


function changeAction(ins)
{var form2 = document.getElementById('button');
if(ins==0)
form2.action = "window.location.reload()";
form1.submit();
}

Kor
06-10-2008, 11:07 AM
The problem starts wrong from the beginning: nesting forms inside other forms is illegal.

As for the rest of your problem, I confess I understood almost nothing. Can you detail your aim, please?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum