+ Reply to Thread
Results 1 to 3 of 3
Like Tree2Likes
  • 2 Post By VPmase

Thread: Javascript submit to form submit

  1. #1
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Javascript submit to form submit

    I have been trying to figure this out for a hour now and im hoping someone can give me some assistance. I need to convert the following code to work with a form.

    Code:
    <script language="JavaScript">
    function newWindow(mypage,myname,w,h,features) {
      if(screen.width){
      var winl = (screen.width-w)/2;
      var wint = (screen.height-h)/2;
      }else{winl = 0;wint =0;}
      if (winl < 0) winl = 0;
      if (wint < 0) wint = 0;
      var settings = 'height=' + h + ',';
      settings += 'width=' + w + ',';
      settings += 'top=' + wint + ',';
      settings += 'left=' + winl + ',';
      settings += features;
      win = window.open(mypage,myname,settings);
      win.window.focus();
    }
    </script>
    
    <a href="javascript:newWindow('sendemail.php?'+document.location.href,'email',400,300,'')">Send Email</a>
    This is what i have so far.

    Code:
          <form name="sample" action="" onsubmit="return newWindow('sendemail.php?'+document.location.href,'email',400,300,'')">
          </form>

  2. #2
    VPmase's Avatar
    VPmase is offline x10 Elder VPmase is an unknown quantity at this point
    Join Date
    Nov 2007
    Location
    Dixon, IL, USA
    Posts
    914

    Re: Javascript submit to form submit

    Well you need a submit button for your form.

    Add "<input type="submit" value="Submit" name="subsample" />" to your form (With out the quotes [" "])
    dinomirt96 and karimirt47 like this.

  3. #3
    e85andyou is offline x10Hosting Member e85andyou is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    49

    Re: Javascript submit to form submit

    I am aware I left that our because I believe there is an error in the way the form is submitting. I use the input below

    Code:
    <input type="image" name="submit" src="../images/tell.jpg" onmouseover="this.src='../images/tell1.jpg';" onmouseout="this.src='../images/tell.jpg';" border="0" alt="Add to Cart" />
    Edit:
    I am still unable to figure this out if anyone has any ideas please let me know.
    Last edited by e85andyou; 11-03-2008 at 08:33 AM. Reason: Automerged Doublepost

+ Reply to Thread

Similar Threads

  1. Javascript form to PHP
    By driveflexfuel in forum Scripts & 3rd Party Apps
    Replies: 3
    Last Post: 10-28-2008, 11:15 PM
  2. Javascript form to PHP
    By driveflexfuel in forum Programming Help
    Replies: 2
    Last Post: 10-16-2008, 06:25 PM
  3. need help with form submit script
    By kbjradmin in forum Programming Help
    Replies: 5
    Last Post: 06-26-2008, 01:02 AM
  4. XML and Javascript
    By cuteboytm in forum Graphics & Webdesign
    Replies: 1
    Last Post: 09-21-2007, 10:00 AM
  5. A simple Visual Basic Login Form
    By Zenax in forum Tutorials
    Replies: 0
    Last Post: 03-13-2007, 08:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers