Jump to content
Fórum Script Brasil
  • 0

Passando variável numa PopUp


Fragata

Question

Pessoal, eu tenho o seguitne script pra abrir uma janela popup

<script LANGUAGE="JavaScript">

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=200,height=300,left = 340,top = 112');");
}
// End -->
</script>
E o seguinte link pra abrir a janela
<input type=button value="Comprar" onClick="java script:popUp('formulario.php')">

O código funciona bem, mas eu queria passar uma variável junto com o endereço 'formulario.php' pra ser pego por get no arquivo formulario.php.

Algo como formulario.php&id=<?=$variavel['id'];?>

Alguém aí tem ideia de como fazer? Obrigado desde já o/

Link to comment
Share on other sites

1 answer to this question

Recommended Posts

  • 0

Ué? você chegou a tentar fazer?

<script>

function teste() {
    var valor = document.getElementById('valor').value;
    var url = "http://www.google.com.br/#q="+valor;
    window.open(url);
}

</script>

<input type='text' id='valor' />
<input type='button' onClick='teste()' value='GOOGLE IT!' />

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      652k
×
×
  • Create New...