Jump to content

Strangest thing ever..


Kane250

Recommended Posts

I have a form that submits data (an email address) to a popup window where the user fills in the rest of their contact information. For some reason it works fine on my index page, but once I add the code to another page to do the same thing, the popup appears but the data from the form does not get submitted to the popup. Furthermore, once this code is added to another page, the original index page doesn't function correctly anymore either until I reupload the index file again...

 

My code is rather lengthy...I'll try and shorten it for you.

 

<script type="text/javascript">
<!--
function wopen(url, name, w, h)
{
// Fudge factors for window decoration space.
// In my tests these work well on all platforms & browsers.
w += 20;
h += -20;
var win = window.open(url,
  name,
  'width=' + w + ', height=' + h + ', ' +
  'location=no, menubar=no, ' +
  'status=no, toolbar=no, scrollbars=no, resizable=no');
win.resizeTo(w, h);
win.focus();
}
// -->
</script>

<div id="emailform">
   <form method="post" action="index.php"/>
   <input type='text' value="" name="email" />
       <div id="emailcheck">
           <input type="submit" value="" class="button" onclick="wopen('mainsub.php', 'popup', 400, 375); return true;" 	onmouseover="this.className='button-over';" onmouseout="this.className='button';" />
</div>
</div>

Link to comment
Share on other sites

if this is on the index page.

 

is it posting to itself?

 

<form method="post" action="index.php"/> 

 

If your copying the code to another page.. does the action not need updating or are you wanting it to go to index.php

Link to comment
Share on other sites

Try this, its the same code that you have, but I took away all the spaces between the window configuration. *There isnt supposed to by any spaces between each of them and its supposed to be all on one line

 

var win = window.open(url,name,'width='+w+',height='+h+',location=no,menubar=no,status=no,toolbar=no,scrollbars=no,resizable=no');

 

Good Luck

 

*http://www.htmlgoodies.com/beyond/javascript/article.php/3471221

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.