advice/help on creating a "pop-up" type message with "sign up to our newsletter" form

Discussion in 'HTML & Website Design' started by fewleh, Nov 24, 2009.

  1. #1
    Hi there guys,

    I'm new to these modal/pop-up windows and divs...

    I've been looking around the internet all day, trying to work out how I can integrate a "sign up here for our newsletter" form...into a (modal) pop up...

    If anyone knows of any tutorials, or can point me in the direction of some code that could help me out, I'd be really thankful. ..

    Many thanks in advance
     
    fewleh, Nov 24, 2009 IP
  2. lastfiend

    lastfiend Greenhorn

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #2
    Place this on your site's header :
    <SCRIPT TYPE="text/javascript">
    <!--
    function popup(mylink, windowname)
    {
    if (! window.focus)return true;
    var href;
    if (typeof(mylink) == 'string')
       href=mylink;
    else
       href=mylink.href;
    window.open(href, windowname, 'width=400,height=200,scrollbars=yes');
    return false;
    }
    //-->
    </SCRIPT>
    Code (markup):
    And include below to trigger the action for pop up window.
    <A HREF="the link you want to pop up" 
       onClick="return popup(this, 'window_title')">popup</A>
    HTML:
     
    lastfiend, Nov 24, 2009 IP
  3. fewleh

    fewleh Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #3
    lastfiend, thanks for your response - which values do I need to substitute in ?

    I'm not sure what the values are "window name" and "window title"

    As you may be able to tell, javascript is not my forte - but if you could just clarify the code slightly, im sure i'll be able to get it sorted

    Also, what is "mylink" ? Is it the url I want to popup? Do I create a seperate .html page that is displayed as the popup?

    Thanks once again for the help, and my lack of knowledge
     
    fewleh, Nov 24, 2009 IP
  4. jpstokes

    jpstokes Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    The mylink is the text in the quotation above ("the link you want to pop up"). You shouldn't have to change the script posted by last friend much...the only change you'll need to make to make this work is to substitute "the link you want to pop up" with the url you want to show up in the pop-up window. BTW, I'm not sure if your looking specifically for a modal implementation, but the script provided isn't a modal it's a pop-up window.
     
    jpstokes, Nov 24, 2009 IP
  5. fewleh

    fewleh Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #5
    Ah, I was looking for a modal...

    I;'ve found a few good looking ones, just not having much luck implementing them and adding in the form. But I'll have to just spend a bit more time getting my head around it I tihnk, and give it a proper go.

    Thanks anyway :)
     
    fewleh, Nov 24, 2009 IP
  6. jpstokes

    jpstokes Peon

    Messages:
    26
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    No problem, I like modal myself but have yet to do one from scratch. Good luck! :D
     
    jpstokes, Nov 24, 2009 IP
  7. lastfiend

    lastfiend Greenhorn

    Messages:
    50
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #7
    I'm sorry for the late reply. windowname and mylink is the variable in javascript, you can leave it alone. What you need to change is as below like for example :

    <A HREF="http://forums.digitalpoint.com" 
       onClick="return popup(this, 'Digital Point')">popup</A>
    HTML:
    On example above, the statement : HREF="http://forums.digitalpoint", is the URL of window you want to pop up, change it into yours. And 'Digital Point' is what you want the pop up window name to be.

    Cheers! :D
     
    lastfiend, Nov 29, 2009 IP