How to preprocess the html address before opening it?

R

rosik

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
 
D

Danny

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
 
J

jrosik

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
 
T

Thomas 'PointedEars' Lahn

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
 
J

jrosik

Hi Tomas!

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

Thanks a lot!
Jiri
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,480
Members
44,900
Latest member
Nell636132

Latest Threads

Top