tags:

views:

64

answers:

2

Hi,

I'm building a small HTML/JS application for primary use on local machine (i.e. everything is accessed via file:// protocol, though maybe in the future it will be hosted on a server within intranet).

I'm trying to make a form with method="get" and action="target.html", in the hope that the browser will put form data in the URL (like, file://<path>/target.html?param1=aaa&param2=bbb). However, it's not happening (target.html opens fine, but no parameters is passed).

What am I doing wrong? Is it possible to use forms over file:// at all? I can always build the url manually (via JS), but being lazy I'd prefer the browser do it for me. ;)

Here is my sample form:

<form name='config' action="test_form.html" method="get" enctype="application/x-www-form-urlencoded">
    <input type="text" name="param1">
    <input type="text" name="param2">
    <input type="submit" value="Go">
</form>
A: 

It might be some browser specific restriction. What browser are you using?

I tested this in Firefox 3.6.3 and Internet Explorer 8, and it works just fine.

Guffa
That's weird.. I just made a bare-bones test and it works indeed! Investigating the differences...
atzz
A: 

Ok, that was stupid. The controls of my form are generated dynamically (via JS), and the generation function was setting ids for them, but not names. So, from the form's point of view, there was no parameters at all.

Thanks to Guffa for providing me a nudge in the right direction!

atzz