Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript thread: Hiding querystring using virtual forms


Message #1 by "Eric Fehrenbacher" <ericf@m...> on Fri, 21 Jul 2000 09:25:26 -0500
This is a multi-part message in MIME format.

------=_NextPart_000_003A_01BFF2F5.9AAD4820
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

I would like to propose an idea and see if anyone has tried this before. 
I here people cry about this all the time and I think it's hiTime we do 
something.

I hate the fact that there is not a way to pass tokens on an IIS server 
from page to page other than using sessions(which are bad - as we all 
know). Instead we all use the querystring or a form to pass things or we 
load it globally upon the sites initial request(again BAD). How many 
times have you gone to an asp site to see those digits in the address 
bar, just waiting to be changed for no other reason than to do it. We 
know we can hide these variables in a form and that it is somewhat 
simple to make a form appear to be a link. But I don't have the time to 
put together a form for every link I must build. My thoughts on this are 
to use JavaScript to Actually make the form based on a link like 
structure. Here's the plan

You need a link to "pageweneed.asp"
Why can't we do this
    <a 
href=3D"javascript:FakeLink("pageweneed.asp","query=3Dstring&could=3Dbe&s
omething=3Dlike&this=3Dline")">Page We Need</a>

First variable passed :: pageweneed.asp
    this would be the actual page we want to locate
Second variable passed :: 
query=3Dstring&could=3Dbe&something=3Dlike&this=3Dline
    this would be broken down into an array of key=3Dvalue type
    then a form could be generated by JavaScript based on the length of 
the array and the key=3Dvalue data

The form would be generated by setting it's name equal to the name of 
the page
And creating a new element for each item in the array which are all 
hidden items (wouldn't really matter if they are hidden or not because 
no one will see them anyway)
The form would need to end up looking like this(remember this will never 
be visible)

    <form name=3D"pageweneed" method=3D"get">
        <input type=3D"hidden" name=3D"query" value=3D"string">
        <input type=3D"hidden" name=3D"could" value=3D"be">
        <input type=3D"hidden" name=3D"something" value=3D"like">
        <input type=3D"hidden" name=3D"this" value=3D"line">
    </form>

After this virtual form is created in JavaScript we would submit the 
form by the standard
    document.pageweneed.submit();
And then close out the function

This is just a brainstorm, I haven't done anything with it yet.
But if it succeeds it will eliminate having to show any querystring at 
all and still provide the ability to pass query strings

Problem :: how do I creat a new form element
        I know I can create or add options to a form but I can't seem to 
get any other form types to be created
        We know how to set the value of elements already created, but 
how do we create a new element




  Return to Index