Results 1 to 4 of 4

Thread: DHTML Window x Form

  1. #1
    Join Date
    Jun 2012

    DHTML Window x Form

    Hey everybody,

    I'm developing a website myself (and I'm not a programmer) where within a service page there is a contact link where the user clicks and it opens an DHTML window. As follow the code:

    script type="text/javascript">
    function openmypage(){ //Define arbitrary function to run desired DHTML Window widget codes
    ajaxwin=dhtmlwindow.open("ajaxbox", "ajax", "../contato/form_geral_caravanas.php?titulo=Rocha Eterna", "Formulário de Contato - Caravanas", "width=450px,height=300px,left=300px,top=100px,resize=1,scrolling=1")
    ajaxwin.onclose=function(){return window.confirm("Fechar formulário de contato?")} //Run custom code when window is about to be closed

    <p>Informações: Quer comprar uma viagem? (11) xxxx.xxxx ou <a href="#" onClick="openmypage(); return false">clique aqui</a>.</p>

    This DHTML window has a contact form and I need it to on subimit the form make the "ok message" in the same dhtml window and I'm not managing to make it work. If I echo the "ok message" it convert the DHTML window in the main window and if I onsubmit="window.close" it closes all windows, including the main window.

    Anyone could help me with this?


  2. #2
    Join Date
    Jun 2012
    Someone suggested to create an alert, I've tried as follow the code:

    mysql_select_db($database_locaweb, $locaweb);
    $Result1 = mysql_query($insertSQL, $locaweb) or die(mysql_error());

    echo "<script>alert('Mensagem enviada com sucesso! Em breve entraremos em contato. ');</script>";

    Wen I press the send button on the contact form now appears a little window with the alert message but when I press ok it makes the form in the main window again.

    Anyone has another idea?


  3. #3
    Join Date
    Aug 2004
    Maybe use onbeforeunload instead of onclose? Or try the JavaScript forum here where the real JS gurus are.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

  4. #4
    Join Date
    Jun 2012
    Thank you but the onclose does not affect the submit form, its just used if someone click the x to close the windown.

    If someone has any other ideia I'm open
    Mean time I will try the JS forum as you suggested!

    Thanks !!!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center