Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    popup + input (need some help)

    i've got the problem ! can't find any same script that can do the following:
    there is an <input> text field on the site ... i create a popup window that lists some RSS feeds from the sites ! (made on PHP) ...and the sctipt must do the this : when you click on the link the URL of RSS inserts into the <input> field ...please help ! any materials (functions,exapmles) are WELCOME !!!

  • #2
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <form name="mForm">
    <input name="rssLoc" type="text" size="35" />
    <input name="mBut" type="button" value="getLoc" onClick="javascript:mForm.rssLoc.value=window.location;" />
    </form>


    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #3
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    great thx a lot ! you really helped !

    may be you know how to read not the value=window.location; but the value of for example the value of HREF ! : <a href="http://www.somesite.com/rss.xml>RSS</a>
    Last edited by netmaniak; 07-12-2004 at 12:54 AM.

  • #4
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm not sure what you're asking, but I think you're talking about something like this:


    <script>
    <!--

    href=window.location.href;
    rss = href.substring(href.lastIndexOf('/')+1);
    function getRSS(){
    mForm.rssLoc.value=rss;
    }

    //-->
    </script>


    <form name="mForm">
    <input name="rssLoc" type="text" size="35">
    <input name="mBut" type="button" value="getLoc" onClick="javascript:getRSS();"> </form>


    You can just change the following line to suit:

    rss = href.substring(href.lastIndexOf('/')+1);

    The above will give you one character past the last "/". But you can do +2, +3, etc. Or -1, -2, etc. Or you can do last index of '.' or '//' etc.


    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #5
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i really sorry for my bad english !! i'll try to explane from the "0 %"

    so i have an <input> field on the 1st window ! near this field there is a link to another window wich i'll create by popup function of JS ! in the 2nd window (popup widnow) there are a lot of links to RSS feeds of sites ! when user click on the link it will automatically appear in the <input> of 1st window !!! (the 2nd problem is that when the user clicked on the link NONE window must appear, only the value of link must be copied to the <input> area in 1st widnow , i've read the it's possible to do by <A HREF="javascript:void(0)">RSS FEED LINK</A>!) ... i hope the situation will be cleared for you

  • #6
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i've found some example but it was only calendar + color select scripts
    Last edited by netmaniak; 07-12-2004 at 01:45 AM. Reason: how to delete the post ??? :(((~

  • #7
    Regular Coder
    Join Date
    Aug 2002
    Location
    USA
    Posts
    625
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I understand your question, using the first form I posted, put this in the popup:


    <a href="#" onClick="javascript:window.opener.document.mForm.rssLoc.value=opener.window.location;return false;">A LINK</a>



    -james
    "God so loved the world that he gave his only begotten son, so that whosoever believed in him would not perish, but have everlasting life. For God did not send his son into the world to condemn the world, but so that through him the world might be saved. "

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,030
    Thanks
    0
    Thanked 247 Times in 244 Posts
    Code:
    function setRSS(rssURL){
       if (opener && !opener.closed) { //make sure the opener window is still open
           opener.document.theForm.theField.value = rssURL;
           opener.focus();
       }
       window.close(); //close popup
       return false;
    }
    ...
    <a href="http://www.somesite.com/rss1.xml" onclick="return setRSS(this.href)">RSS FEED LINK 1</a>
    <a href="http://www.somesite.com/rss2.xml" onclick="return setRSS(this.href)">RSS FEED LINK 2</a>
    <a href="http://www.somesite.com/rss3.xml" onclick="return setRSS(this.href)">RSS FEED LINK 3</a>
    ...

  • #9
    New to the CF scene
    Join Date
    Jul 2004
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx a lot for help ! great respect to all !!!


  •  

    Posting Permissions

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