42 users online (1 members and 41 guests)  


  Results 1 to 6 of 6

Related

  1. Replies: 1
  2. Replies: 4
  3. Replies: 1
  4. Form Handling Script for 'Tell A Friend' Form    Forum: Javascript Forum
    Replies: 1
  5. Replies: 3
  1. #1
    Kaner9000's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2

    Exclamation Initializing a form

    I would like to be able to have a web page with a list of links. Upon clicking on a link, it will open a new page with a form that has the text of the link I clicked on, inserted into a textbox in the form. I would only like to have one page with a form where no matter which link i click on the previous web page, that link text is loaded into the one form. I hope this makes sense. I am having trouble finding a way to do this. Hopefully someone can help.

  2. #2
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Hello, welcome to the forums.

    I am sure this can be done using JavaScript. I am just going to try it, then I will post thye code.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  3. #3
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    Okey-doke. I did it a slightly odd way.

    Here is the entire code example -

    Code:
    <HEAD>
    
    <SCRIPT LANGUAGE="JavaScript">
    <!-- Thanks to Nic Wolfe  http://fineline.xs.mw -->
    
    <!-- Begin
    function popup_amended(TXT) {
    
    formstuff='<form method="post" action="badger.php"><input type="text" name="stoat" value="' + TXT + '"></form>'
    
    
    win=window.open('about:blank','NamedWindow', 'toolbar=0,scrollbars=0,location=1,statusbar=1,menubar=1,resizable=0,width=300,height=300,left = 362,top = 234');
    win.document.write(formstuff);
    }
    // End -->
    </script>
    
    </HEAD>
    
    <A HREF="javascript:popup_amended('THIS IS THE TEXT PASSED')">Open the Pop Up Window</A>
    The popup code was taken from our popup maker tool and then amended slightly by me.

    The code works like this -

    You click the link, and it calls a javascript function called popup_amended. It passes the text you want in the function call, so it can be different for each link.

    The function itself first builds your form code (amend it in the function to suit yours) including as the value the text passed from the link. It then opens a popup window, then writes the form information to the newly opened window.

    And voila, it works.
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?

  4. #4
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel
    dang your good

  5. #5
    Kaner9000's Avatar
    New User

    Status
    Offline
    Join Date
    Aug 2003
    Posts
    2

    Thanks!

    Thanks for the help, works great!!

  6. #6
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    yay

    glad it helps
    If one of our members helps you, please click the icon to add to their reputation!
    No support via email or private message - use the forums!
    Before you ask, have you Searched?



Tags for this Thread