"milkyway" <d0******@hotmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Hello again everyone :-)
Adding more clarification below ...
Erwin Moller wrote: milkyway wrote:
Hi,
Yes, just call the submit() method of a form, like this:
<form action="secretposting.php" name="aForm"> <input type="hidden" name="var1" value="hai">
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
the thing is that I do not have an <input ....> defined for every
value
I wish to send to the server. I remember (in the old days), the string
sent to the server would sook something like:
So create an <input> for every value you want to send to the server.
http://groupsbeta.google.com/group/c...reply_to=group
See how the '&'is used to separate the <value name / value>
combinations? Something like:
You'll get the exact same thing from:
<form method="GET" action="your_form_handler.jsp">
<!-- note method="GET" -->
<input type="hidden" name="a" value="b">
<input type="hidden" name="c" value="d">
<input type="hidden" name="e" value="f">
http://clothes.com/run_this?socks=blue&shirts=10& ...
How would one generate the string to send to the server? Is there a
better way to get data to the server?
I am open for any suggestions.
Please explain what you are trying to do. If you have a link that
displays a specific product for example, you do something like this _on_
_the_ _server_:
// read the database for product ids and names
// pretend the data returned is in -dataset-
for (var i = 0; i < dataset.rows_returned; ++i) {
print_to_client(
"<a href=\"/products/look_at_product.jsp?" +
"product_id=" +
dataset.getRow(i).getColumn("product_id") +
"\">" +
dataset.getRow(i).getColumn("product_name") +
"</a>"
);
}
Then /products/look_at_product.jsp would do something like:
var product_id = Request.value("product_id");
// run the following SQL safely:
// "select * from products
// where product_id=" + product_id
// (Note: never never never just stick
// untrusted data like -product_id-
// obtained from the client and simply
// use it to build SQL)
// now display the stuff retrieved from
// the database query, or display an
// error if the product couldn't be
// found or whatever
So like I said, please explain what you are attempting to do. I think
you don't need JavaScript at all (but without more details I can't tell
for sure). If you are trying to display information about data you have
on the server, write the links as shown, from the server.
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq