51 users online (0 members and 51 guests)  

Thread: Form input link


  Results 1 to 10 of 10

Related

  1. form input changes textarea output    Forum: Javascript Forum
    Replies: 1
  2. form input    Forum: HTML Forum
    Replies: 5
  3. Help W/ interactive user input form    Forum: Javascript Forum
    Replies: 1
  4. Form input type    Forum: HTML Forum
    Replies: 1
  5. HTML Form input types    Forum: HTML Forum
    Replies: 3
  1. #1
    justlasers's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2002
    Posts
    4

    Form input link

    Hi there,

    I need to know if it is possible to have a link which goes to a form but inserts text into a form element.

    Thanks



    Ian

  2. #2
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    Assuming that the data to be inserted is the same each time, why not just place it in the FORM itself?

    Go to

    http://jamrent.50megs.com/coa/admin.htm#sign

    to see an example of a FORM with a couple fields partially filled in.

  3. #3
    justlasers's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2002
    Posts
    4
    Thanks, but all the data is different.


    Cheers anyway



    Ian

  4. #4
    justlasers's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2002
    Posts
    4
    Thanks, but all the data is different.


    Cheers anyway



    Ian

  5. #5
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    if there is it's more work than I want to do. It would be easy if you just wanted different text anywhere, but I can't get it to work in the form fields. Sorry, your gonna have to research that one yourself.

  6. #6
    Derek's Avatar
    Be Yourself

    Status
    Offline
    Join Date
    Aug 2001
    Location
    St. George, Utah, USA
    Posts
    466
    Now that I think of it you could use PHP:

    have form fields each with something like:

    Code:
    form1.php, form2.php, form3.php, form4. php
    then on your link page you have your links:

    Code:
    <a href="blah.php" name="link1">
    <a href="blah.php" name="link2">
    <a href="blah.php" name="link3">
    <a href="blah.php" name="link4">
    then on your blah.php page put this code:

    PHP Code:
    <?php
    if ($link1) {
    include(
    "form1.php");
    }
    if (
    $link2) {
    include(
    "form2.php");
    }
    if (
    $link3) {
    include(
    "form2.php");
    }
    if (
    $link4) {
    include(
    "form2.php");
    }
    ?>
    So on each of the differen't forms, set the
    Code:
    <input value="whatever you want for this certain form">
    Is this even near what your asking? I dunno I just barely thought of it.

  7. #7
    QuietDean's Avatar
    Administrator

    Status
    Offline
    Join Date
    Oct 2000
    Location
    Bournemouth, UK
    Posts
    2,662
    lo there.

    As long as you have access to a server side language, you could use query strings.

    Code:
    a href="form.php?animal=badger&legs=4"
    Then on the next page, some code to fill in the values -

    PHP Code:

    < input type="text" name="animal" value="<?=$animal?>">

    <input type="text" name="legs" value="<?=$legs?>">
    Hope that 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?

  8. #8
    Enigma's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Nov 2000
    Posts
    426
    If you don't have access to a server side scripting language, you can probably do it with Javascript as well to strip off something sent after the URL (e.g., http://mysite.com/page.html?something).

    You can isolate what's after the ? and store it as a variable:

    var string_url = new String(document.location);
    var string_array = string_url.split("?");
    var query = string_array[length + 1];

  9. #9
    justlasers's Avatar
    New User

    Status
    Offline
    Join Date
    Mar 2002
    Posts
    4

    Forms?!?

    Thankyou all for your help. I'm not to sure if one of these will help, what i need is:


    Say you've got somthing a product on a shopping cart, but at the moment you don't have it in stock. What i want to happen is for the link which would say "Add to Cart" to take you to a page with a form on where you could back order the product. As it is best for the consumer todo as little work and thinking as possible, all want is for the form to be filled in with the product they want and for them to just fill in there details.



    Thanks again for all the help


    Ian

  10. #10
    benzden's Avatar
    Senior Member

    Status
    Offline
    Join Date
    Feb 2002
    Location
    San Antonio, Texas
    Posts
    652
    None of what you've indicated should require the user to do anything except see a screen with a description of the item, it's "back order" status (usually the period of time it will take to actually get it), possible alternatives to order instead, possible alternative locations where it can be purchased (competitiors - you'll be surprised at how pointing this out will increase your own business) and check boxes for the visitor to click to place the item on backorder status or order (into their shopping cart, presumably) any one or more of the alternatives.

    Given that you've already got the other information from the visitor/purchaser, there should be no need for them to fill out a separate "back order" FORM. In fact, you don't want the visitor filling out any EXTRA forms at all.

    I have always left online shopping cart sites after the first error encountered - presuming the rest of the stay at that site is going to just be a big waste of time.



Tags for this Thread