|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
cant open a new window?
can anyone with my code? its within in a form: i need to click on the button to have a pop-up window and then the customer code will bring to the pop-up window, but seems my code doesnt work.
<head> <script language="JavaScript"> function MM_openBrWindow(theURL,winName,features) { var id=document.form1.code.value; window.open(theURL+"?code="+code,winName,features); } </script> </head> <form> . . <td width="34%"><input name="code" value="" type="text" id="code"> </td> . . <td><input name="btn1" type="button" onClick="MM_openBrWindow('addcontact.php','search1','scroll bars=yes,resizable=yes,width=500,height=500')" value="Search"> please help.... |
|
#2
|
|||
|
|||
|
Message Moved
Thread moved from 'PHP Coding' to 'Client Side Things' by tkarkkainen.
Reason: JavaScript |
|
#3
|
|||
|
|||
|
RE: cant open a new window?
ok, on this line of the JS function
window.open(theURL+"?code="+code,winName,features); your are constructing th URL with a variable called 'code' which does not exist. you are referencing the value of the textbox earlier on with this line... var id=document.form1.code.value; so your window.open call should look like this... window.open(theURL+"?code="+id,winName,features); (make sure your form is named 'form1' or you will get an error) Change that and everything should work fine. |
![]() |
| Viewing: Codewalkers Forums > Other Technologies > Client Side Things > cant open a new window? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|