...

View Full Version : How to make new page open in the same window.



coolguyraj
07-20-2009, 11:04 AM
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+'&visitormail='+visitormail+'&visitorcomp='+visitorcomp+'&visitorphone='+visitorphone+'&notes='+notes+'&attn='+attn,'MyWindow','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,re sizable=no,width=200,height=100);

Thanks

abduraooft
07-20-2009, 11:19 AM
<a href="regprocess1.php? .... and all parameters here....">Reg Process</a>???

coolguyraj
07-20-2009, 11:37 AM
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)


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,scrollbar s=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

abduraooft
07-20-2009, 11:50 AM
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) ?

coolguyraj
07-20-2009, 12:22 PM
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

abduraooft
07-20-2009, 12:40 PM
Can't you add a hidden input element and assign the required value to it before submit?

coolguyraj
07-20-2009, 12:52 PM
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

abduraooft
07-20-2009, 01:00 PM
window.onload=function(){
document.getElementById('mac').value=document.macaddressapplet.getMacAddress();
}

<input type="hidden" name="mac" id="mac"> ?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum