rogernem
March 9th, 2006, 01:31 PM
I have a page in php (main.php) with the following javascript code:
<script language="javascript">
function param(valor){
var i = valor.nome.value;
var w = valor.width.value;
var h = valor.height.value;
window.open("pop.php?id="+i+"","aaaa","left=0,top=0,resizable=no,scrollbars=auto,width="+w+",height="+h+"");
}
</script>
and this is what i have in my php page (main.php):
<form name="valor" action="<?=$PHP_SELF?>" onSubmit="param(this)">
<input type="hidden" name="nome" value="<?=$rt['id'];?>">
<input type="image"src="imagens/carro/peq/<?=$rt['nome_ico'];?>" >
<input type="hidden" name="width" value="<?=$origem_x?>">
<input type="hidden" name="height" value="<?=$origem_y?>">
</form>
when i click the image the popup works fine but it reloads the main.php to this url:
http://www.site.com.br/main.php?nom...=365&x=103&y=95
i dont want it to reload when i click.
any ideas???
<script language="javascript">
function param(valor){
var i = valor.nome.value;
var w = valor.width.value;
var h = valor.height.value;
window.open("pop.php?id="+i+"","aaaa","left=0,top=0,resizable=no,scrollbars=auto,width="+w+",height="+h+"");
}
</script>
and this is what i have in my php page (main.php):
<form name="valor" action="<?=$PHP_SELF?>" onSubmit="param(this)">
<input type="hidden" name="nome" value="<?=$rt['id'];?>">
<input type="image"src="imagens/carro/peq/<?=$rt['nome_ico'];?>" >
<input type="hidden" name="width" value="<?=$origem_x?>">
<input type="hidden" name="height" value="<?=$origem_y?>">
</form>
when i click the image the popup works fine but it reloads the main.php to this url:
http://www.site.com.br/main.php?nom...=365&x=103&y=95
i dont want it to reload when i click.
any ideas???