Web Hosting Forums

Results 1 to 7 of 7

This is a discussion on Text boxes in HTML/PHP/JavaScript in the Hosting Talk & Chit-chat forum
Hellllooooo, I'd like to fill the text box in a form, based on input from the URL... but, the kicker is... I can't modify the ...

  1. #1
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,503

    Text boxes in HTML/PHP/JavaScript

    Hellllooooo,

    I'd like to fill the text box in a form, based on input from the URL... but, the kicker is... I can't modify the code inside the form.

    Is there a way to use PHP or javascript to fill in a form from outside that form's HTML tags?

    Thanks in advance,
    Ron,
    Presentationally Challenged

  2. #2
    Loyal Client
    Join Date
    Oct 2003
    Location
    Location: Location:
    Posts
    634
    I'm just gonna guess here...

    Do you know the form variable name? If so, can you create a hidden field in a new form that sucks up the the URL?

    for example, if your form variable is "whereFrom_url", and the var from the url is of the form &answer=blahblahblah...

    something like this might be of use:
    tempVar = str(answer);
    var whereFrom_url = tempVar;

    excuse the poor syntax and type declaration - I'm making it up. but the idea might work for you...

  3. #3
    Ron
    Ron is offline
    Loyal Client
    Join Date
    Aug 2002
    Posts
    7,503
    Well, what you suggest might work, but it just wouldn't accomplish what I need.

    I actually figured out a way to do it with javascript. I've never touched javascript before, and I'm having a difficult time in finding a resource for all of its available classes and methods.

    Next question: Anybody know of a javascript class to deal with parsing URLs for search engine terms?

    I found a very old server-side cgi in perl that does this using REFERRER, but it is ancient, and I would have to heavily modify it, then I'd have to execute the cgi to build the javascript to pass the terms to the javascript. I'd like to do both in one place, and since the javascript is a requirement, it might as well be there.

  4. #4
    || $name ne 'R.Stiltskin'
    Join Date
    Jun 2003
    Location
    Tejas
    Posts
    2,414
    Originally posted by Ron
    I actually figured out a way to do it with javascript... and I'm having a difficult time in finding a resource for all of its available classes and methods.
    ...I found a very old server-side cgi in perl that does this using REFERRER...
    Can't offer much help here because I rarely work in javascript but I always have the source at hand to start:
    Netscape Devedge
    Since you've got it working now, just keep this link in your repertoire if it's not there already.

    Also, you got a script to use "REFERRER"? That's a good trick. That original spec misspelling always drives me nuts. It has caused untold numbers of coders all sorts of grief.

  5. #5
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Originally posted by Ron
    ...I found a very old server-side cgi in perl that does this using REFERRER, but it is ancient, and I would have to heavily modify it...
    It must be ancient. It's called 'REFERER' now. Maybe that's why you're having problems...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  6. #6
    Yeah, I know a LOT! Vin DSL's Avatar
    Join Date
    Mar 2003
    Location
    Arizona Uplands
    Posts
    10,661
    Originally posted by Spathiphyllum
    ...Also, you got a script to use "REFERRER"? That's a good trick. That original spec misspelling always drives me nuts. It has caused untold numbers of coders all sorts of grief.
    Oops! Guess I should have read the whole thread first...
    DISCLAIMER Any resemblance between the views expressed above and those of the owners and operators of this system is purely coincidental. Any resemblance between these views and my own are non-deterministic. The existence of Vin DSL is questionable. The existence of views in the absence of anyone to hold them is problematic. The existence of the reader is left as an exercise in the second-order coefficient.

    No Guts, No Story! VinDSL 2010

  7. #7
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    5,884
    Another good site is http://msdn.microsoft.com/scripting. Although some of the DOM objects in IE are completely off-standard, most of their "JScript" is in line with the real JavaScript, and I've always liked the way the language reference is set up (although the original scripting site of several years ago was better, IMHO). If nothing else, this site is a good source for troubleshooting why the script's not working in IE.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

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
  •