Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts

    How to make new page open in the same window.

    Hi.

    I have this javascript to open a new page.Currently it open the page but opens it as a pop up.

    How can i change to open in the same page.

    window.open('regprocess1.php?mac='+document.macaddressapplet.getMacAddress()+'&visitor='+visitor+'&v isitormail='+visitormail+'&visitorcomp='+visitorcomp+'&visitorphone='+visitorphone+'&notes='+notes+' &attn='+attn,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,r esizable=no,width=200,height=100);

    Thanks

  • #2
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    <a href="regprocess1.php? .... and all parameters here....">Reg Process</a>
    ???
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #3
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi,

    Thanks for the reply.

    I am calling the following function using onclick over a button.So tha when the s"submit button is clicked it should go to the "message successfully sent page"(regprocess1.php)

    Code:
    function submitForm()
                {
                    document.macaddressapplet.setSep( "-" );
                    var visitor = document.getElementById('visitor').value;
                    var visitormail = document.getElementById('visitormail').value;
                    var visitorphone = document.getElementById('visitorphone').value;
                    var visitorcomp = document.getElementById('visitorcomp').value;
                    var attn = document.getElementById('attn').value;
                    var notes = document.getElementById('notes').value; 
                                   window.open('regprocess1.php?mac='+document.macaddressapplet.getMacAddress()+'&visitor='+visitor+'&visitormail='+visitormail+'&visitorcomp='+visitorcomp+'&visitorphone='+visitorphone+'&notes='+notes+'&attn='+attn,'_self','MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=200,height=100');
    		 
                }
    should i use it like window.open(<a href="regprocess1.php...Parameters....></a>

    Please let me know.

    Thanks

  • #4
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    function submitForm()
    Why do you need to submit your form with a javascript(unreliable) method?

    Can't you just make a form having regprocess1.php in the action attribute and get in the method attribute (along with an input element of type submit) ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #5
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi,

    The problem here is i am capturing the MAC addres of the system.I can do it only using javascript.So in order to pass the variaab;les to PHP i am doing it this way.

    Let me know if you have aany other suggestions.

    Thanks

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Can't you add a hidden input element and assign the required value to it before submit?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    New Coder
    Join Date
    Nov 2005
    Posts
    93
    Thanks
    5
    Thanked 0 Times in 0 Posts
    Hi,

    mac= document.macaddressapplet.getMacAddress();
    this value i get it from javascript function

    how can i pass it as hidden variable.

    could you please help me.

    Thanks

  • #8
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,861
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    Code:
    window.onload=function(){
    document.getElementById('mac').value=document.macaddressapplet.getMacAddress();
    }
    Code:
    <input type="hidden" name="mac" id="mac">
    ?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)


  •  

    Posting Permissions

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