SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Las Vegas
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    need some script help...

    hi all, i'm working out some kinks for a new site....hoping someone can help.

    anyways, thework in progress is at http://www.westcoastfilmworks.com/index_1.htm

    on the left side of the navigation, the link to join the newletter list will pop a small window with the code to join into the list. once they type in the email address and click submit, it pops a new window giving info on if the submittal was clean or if they were in the database already. what i need to do though is get the first small window to close automatically when they click the submit button. as it is right now, the last page just loads on top of it, but i'd rather have it close without the user having to wonder why its still sitting there after they submitted their info.

    i appreciate any help on this.
    thanks!
    -tyson

  2. #2
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what server side language are you using to access your database then?

    oh nm i just read what you wrote wrong gimme a min

  3. #3
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Las Vegas
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good question.....

    the mail list script is called MyMail, and interacts with a MySQL database. here's the site for them http://www.codingclick.com/scripts/MyMail/

    if there isn't a javascript way to do what i'm looking for, can anyone suggest a better way of achieving the same effect?

    thanks!

  4. #4
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    your html looks a bit cleaner as well

    PHP Code:

    <html>
    <
    head>
    <
    meta name="ProgId" content="FrontPage.Editor.Document">
    <
    meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
    <
    title>Enter Your Email Address</title>
    </
    head>
    <
    BODY BGCOLOR=#FFFFFF topmargin="0" leftmargin="0">
    <div align="center"
      <
    center>
        <
    table border="0" cellspacing="0" bordercolor="#111111" width="25%" id="AutoNumber1" height="144" background="http://www.westcoastfilmworks.com/images/newsletter_pop.gif">
          <
    tr
            <
    td width="100%" height="112">&nbsp;</td>
          </
    tr>
          <
    tr
            <
    td width="100%" height="22" align="center"
              <
    form method="post" name="form1" action="http://www.westcoastfilmworks.com/MyMail/entry.php?action=add" target="_blank">
                <
    table width="209" border="0" cellspacing="0" cellpadding="3">
                  <
    tr
                    <
    td colspan="2"
                      <
    p align="center"> <font size="2" face="Verdana" color="#FF0000"><b>Enter 
                        Your Email Address
    </b></font
                    </
    td>
                  </
    tr>
                  <
    tr
                    <
    td colspan="2"
                      <
    p align="center"
                        <
    input type="text" name="email" size="20">
                        <
    input type="hidden" name="listID" value="1">
                        <
    input type="submit" name="Submit" value="Go" onclick="form1.submit;window.close()">
                      </
    p>
                    </
    td>
                  </
    tr>
                  <
    tr
                    <
    td
                      <
    input type="radio" name="what" value="sub" checked>
                      <
    font color="#FFFFFF" size="2" face="Verdana">Subscribe</font><br>
                    </
    td>
                    <
    td> <font size="2" face="Verdana"
                      <
    input type="radio" name="what" value="unsub">
                      <
    font color="#FFFFFF"Unsubscribe </font> </font> </td>
                  </
    tr>
                </
    table>
              </
    form>
            </
    td>
          </
    tr>
        </
    table>
      </
    center>
    </
    div>
    </
    body>
    </
    html

  5. #5
    SitePoint Enthusiast
    Join Date
    Aug 2001
    Location
    Las Vegas
    Posts
    62
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    wow....you're awesome


    thanks for the jab about my sloppy code....ROFL, i'm more of a design guy who had to learn some html, than the other way around.

    i appreciate it!

    -tyson

  6. #6
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats my prob only thing is with that code i think you get an alert to prompt closing the window, but im not sure if you can prevent that by calling the popup windows name from the parent window (the window you called it from) and closing it from there eg


    as u neva named your popup

    say

    PHP Code:

    function Popup() { 

    if (
    br == "n4"||br == "n3"){ 
    x.window.open('newsletter.htm''newsletter''directories=no,location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,height=250,width=250'
    }else if (
    br == "e4"||br == "e3"){ 
    x.window.open('newsletter.htm''newsletter''directories=no,location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,height=250,width=250'
    }else { 
    x.window.open('newsletter.htm''newsletter''directories=no,location=no,menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no,height=250,width=250'



    -------------------------------------------------------

    and use

    -------------------------------------------------------

    x.window.close() 
    also you've put a lot of unnecessary coding in which could be much shorter and faster to load

    eg

    PHP Code:

    var preloadFlag false;
    function 
    preloadImages() {
        if (
    document.images) {
            
    top_nav_bar_rolloversandls_01_over newImage("http://www.westcoastfilmworks.com/images/top_nav_bar_rolloversand-02.gif"); 
    instead use
    PHP Code:
    var preloadFlag false;
    var 
    dir "http://www.westcoastfilmworks.com/images/";
    function 
    preloadImages() {
        if (
    document.images) {
            
    top_nav_bar_rolloversandls_01_over newImage(dir "top_nav_bar_rolloversand-02.gif"); 
    Last edited by Andrew-J2000; Apr 6, 2002 at 20:14.


Bookmarks

Posting Permissions

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