How to preprocess the html address before opening it?

Discussion in 'Javascript' started by rosik@volny.cz, Mar 15, 2006.

  1. Guest

    Hallo,

    is it possible to open a page like this:

    http://www.mydb.com/query.php?Lng=1&Edn=2&Sch=5&Sky=4&ID=MY_TEXT_HERE&Ava=Gt5

    from a local page which would look like this:
    ----- local page starts -----
    Enter ID: ....MY_TEXT_HERE......
    [Search]
    ----- local page ends ------

    The field <MY_TEXT_HERE> should be substitued with the text entered
    into the local page. I think that it should be possible with some kind
    of client-side scripting - javascript or vbscript or something similar.

    Thanks,
    Jiri Rosicky
    , Mar 15, 2006
    #1
    1. Advertising

  2. Danny Guest

    I gather you want to automate some server script call/submission,
    just in the local page, make the form as it's on the server, and for
    Action, give the full url, including http://....., and fill out the
    fields Value=".." respectively, you can even submit it upon opening
    by means of <body onload="document.forms[0].submit()">.

    Danny
    Danny, Mar 15, 2006
    #2
    1. Advertising

  3. Guest

    Thanks for reply. I am not sure if I wrote my question clearly. Ok, I
    would like to have a local page with an input for entering some text -
    say "FUN". After pressing the submit button on that local page I would
    like to open (in a new browser window) a url like this:

    http://www.mydb.com/query.php?Lng=1&Edn=2&Sch=5&Sky=4&ID=FUN&Fgx=45

    I am not very familiar with javascript so an example would be great!

    Thanks,
    Jiri Rosicky
    , Mar 15, 2006
    #3
  4. wrote:

    > is it possible to open a page like this:
    >
    >

    http://www.mydb.com/query.php?Lng=1&Edn=2&Sch=5&Sky=4&ID=MY_TEXT_HERE&Ava=Gt5
    >
    > from a local page which would look like this:
    > ----- local page starts -----
    > Enter ID: ....MY_TEXT_HERE......
    > [Search]
    > ----- local page ends ------
    >
    > The field <MY_TEXT_HERE> should be substitued with the text entered
    > into the local page. I think that it should be possible with some kind
    > of client-side scripting - javascript or vbscript or something similar.


    Yes, it is possible with client-side scripting. No, this should not
    be done that way. It is in fact merely a matter of Web development
    and HTML basics:

    <form action="http://www.mydb.com/query.php">
    <input type="hidden" name="Lng" value="1">
    <input type="hidden" name="Edn" value="2">
    <input type="hidden" name="Sch" value="5">
    <input type="hidden" name="Sky" value="4">

    <label for="myID">Enter ID:</label>
    <input name="ID" id="myID" value="MY_TEXT_HERE">

    <input type="hidden" name="Ava" value="Gt5">

    <input type="submit" value="Search">
    </form>

    RTFM. STFW.


    PointedEars
    Thomas 'PointedEars' Lahn, Mar 15, 2006
    #4
  5. Guest

    Hi Tomas!

    Your code solves exactly what I need! I am wondered there is no need to
    use javascript:)

    Thanks a lot!
    Jiri
    , Mar 17, 2006
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Chris Croughton

    Utility to partially preprocess

    Chris Croughton, Nov 1, 2004, in forum: C Programming
    Replies:
    11
    Views:
    563
    Chris Croughton
    Nov 4, 2004
  2. =?iso-8859-1?Q?David_S=E1nchez_Mart=EDn?=

    mod_python preprocess/filter before proxy

    =?iso-8859-1?Q?David_S=E1nchez_Mart=EDn?=, Sep 27, 2007, in forum: Python
    Replies:
    1
    Views:
    1,088
    Graham Dumpleton
    Sep 28, 2007
  3. C. J. Clegg

    Whitespace before opening paren in function call?

    C. J. Clegg, Mar 7, 2009, in forum: C Programming
    Replies:
    2
    Views:
    502
    Kaz Kylheku
    Mar 7, 2009
  4. John Smith
    Replies:
    2
    Views:
    285
    Brian McCauley
    Dec 1, 2003
  5. yary
    Replies:
    5
    Views:
    797
    Michele Dondi
    Feb 29, 2008
Loading...

Share This Page