can't submit a form [revised]

J

JRough

Sorry, I just fixed the form and tried to remove my other post. I
fixed the form so it only has one field. That is the <textarea> #q </
textarea> and my database subtitutes the #q for a serialized list I
want posted by the form. Then php will set $q = $_POST['q']; The
problem is the value doesn't seem to get posted. I tried the
document.write as a way to test for the value but I don't think that
is right. I would like to make the <textarea> </textarea> field a
hidden field. HOw can I hide it? But let me know if you see why it
isn't getting posted? It might be something else but since the field
isn't hidden I do see the serialized list in the "textarea" field and
as far as I can see it isn't getting posted.

tia,

<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>
#q
</textarea>
<script type =”text/javascript”>
document.write(q);
</script>

</form>
</body>
</html>
 
V

VK

Sorry, I just fixed the form and tried to remove my other post.  I
fixed the form so it only has one field.  That is the <textarea> #q </
textarea>  and my database subtitutes the #q for a serialized list I
want posted by the form.  Then php will set $q = $_POST['q'];  The
problem is the value doesn't seem to get posted.  I tried the
document.write as a way to test for the value but I don't think that
is right.  I would like to make the   <textarea> </textarea> field a
hidden field.  HOw can I hide it?  But let me know if you see why it
isn't getting posted?  It might be something else but since the field
isn't hidden I do see the serialized list in the "textarea" field and
as far as I can see it isn't getting posted.

tia,

<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>
#q
</textarea>
<script type =”text/javascript”>
document.write(q);
</script>

</form>
</body>
</html>

1) JavaScript code is either in <script>...</script> blocks or in
intrinsic event handlers like onload="..."
You cannot just drop separate instructions among HTML tags.
2) HTML and JavaScript are having two types of quotes: straight single
one ' and straight double one "
Check your authoring software as it has some fantastic quoting
settings.


<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Demo</title>
<script type ="text/javascript">
var q = 'server data';
</script>
</head>
<body onload="
var frm = document.forms['pgform'];
frm.elements['q'].value = q;
document.forms['pgform'].submit();
">
<form name="pgform" action="http://99.20.131.64/pooglemap2.php">
Serialized Address List:
<textarea name="q"></textarea>
<script type ="text/javascript">
document.write(q);
</script>
<input type="submit" value="show map">
</form>
</body>
</html>
 
E

Evertjan.

JRough wrote on 25 okt 2009 in comp.lang.javascript:
Sorry, I just fixed the form and tried to remove my other post. I
fixed the form so it only has one field. That is the <textarea> #q </
textarea> and my database subtitutes the #q for a serialized list I
want posted by the form. Then php will set $q = $_POST['q']; The
problem is the value doesn't seem to get posted. I tried the
document.write as a way to test for the value but I don't think that
is right. I would like to make the <textarea> </textarea> field a
hidden field. HOw can I hide it? But let me know if you see why it
isn't getting posted? It might be something else but since the field
isn't hidden I do see the serialized list in the "textarea" field and
as far as I can see it isn't getting posted.

tia,

<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>

I do not think a twextatra can have a value!

[or a type for that matter!!!]
#q
</textarea>
<script type =”text/javascript”>
document.write(q);

q will probably only be recognized as the textarea element in IE,
in other browsers it will fail, stopping js execution.
 
J

JRough

Sorry, I just fixed the form and tried to remove my other post.  I
fixed the form so it only has one field.  That is the <textarea> #q </
textarea>  and my database subtitutes the #q for a serialized list I
want posted by the form.  Then php will set $q = $_POST['q'];  The
problem is the value doesn't seem to get posted.  I tried the
document.write as a way to test for the value but I don't think that
is right.  I would like to make the   <textarea> </textarea> field a
hidden field.  HOw can I hide it?  But let me know if you see why it
isn't getting posted?  It might be something else but since the field
isn't hidden I do see the serialized list in the "textarea" field and
as far as I can see it isn't getting posted.

tia,

<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>
#q
</textarea>
<script type =”text/javascript”>
document.write(q);
</script>

</form>
</body>
</html>

That is nice javascript, I understand the DOM objects. I did notice
that you didn't include the method = "post".
Doesn't it need the method "post"? Thank you for noticing the curly
quotes. I found a setting for straight quotes. It is a desktop
database and I guess that was like a typing program.
 
S

SAM

Le 10/25/09 12:20 AM, JRough a écrit :
<html>
<body onload=”document.forms['pgform'].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>

ther is NO attribute value in a textarea tag !

#q IS the value of he textarea

</textarea>
<script type =”text/javascript”>
alert(document.forms['pgform'].elements['q'].value);

document.write(q);

document.write(document.pgform.q.value);
// maybe if the script is in the same form as the textarea :
document.write( q.value );
 
S

SAM

Le 10/25/09 1:03 AM, Evertjan. a écrit :
JRough wrote on 25 okt 2009 in comp.lang.javascript:
<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>

<textarea name=”q” value= “hidden”>

I do not think a twextatra can have a value!

[or a type for that matter!!!]
#q
</textarea>
<script type =”text/javascript”>
document.write(q);

q will probably only be recognized as the textarea element in IE,
in other browsers it will fail, stopping js execution.

Not false and maybe that
forms[’pgform’]
where single quotes are replaced by accents
will not help then ... ?
 
T

Thomas 'PointedEars' Lahn

JRough said:

That is nice javascript, I understand the DOM objects.

Unfortunately, you do not understand how to post properly, posting a follow-
up to your own posting but replying to another person's posting.
I did notice that you didn't include the method = "post".

Who is "you"?
Doesn't it need the method "post"?

Depends on your server-side script.
Thank you for noticing the curly quotes.

I found a setting for straight quotes. It is a desktop
database and I guess that was like a typing program.

I beg your pardon?


PointedEars
 
V

VK

JRough said:
That is nice javascript, I understand the DOM objects.  I did notice
that you didn't include the method = "post".
Doesn't it need the method "post"?

You are welcome. Yes, it needs method="POST" because the default
method is GET. I must be accidentally deleted it when correcting the
code.
Thank you for noticing the curly
quotes.  I found a setting for straight quotes.  It is a desktop
database and I guess that was like a typing program.

You may play around with that simple script below. Make a copy and
torture it in any imaginable way :) to feel yourself more comfortable
with JavaScript

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Test</title>
<script type="text/javascript">
function test(elm, frm) {
var out = frm.output;
var p = '';
for (p in frm) {
out.value+= p+' = '+frm[p]+'\n';
}
}
</script>
</head>
<body>
<form name="myForm" action="">
<textarea name="output"
cols="60" rows="10"></textarea>
<br>
<input type="button" value="Test"
onclick="test(this, this.form)">
</form>
</body>
</html>
 
C

Captain Paralytic

Sorry, I just fixed the form and tried to remove my other post.  I
fixed the form so it only has one field.  That is the <textarea> #q </
textarea>  and my database subtitutes the #q for a serialized list I
want posted by the form.  Then php will set $q = $_POST['q'];  The
problem is the value doesn't seem to get posted.  I tried the
document.write as a way to test for the value but I don't think that
is right.  I would like to make the   <textarea> </textarea> field a
hidden field.  HOw can I hide it?  But let me know if you see why it
isn't getting posted?  It might be something else but since the field
isn't hidden I do see the serialized list in the "textarea" field and
as far as I can see it isn't getting posted.

<html>
<body onload=”document.forms[’pgform’].submit()”>
<form name=”pgform” action=”http://99.20.131.64/pooglemap2.php”
method=”post”>
<textarea name=”q” value= “hidden”>
#q
</textarea>
<script type =”text/javascript”>
document.write(q);
</script>
</form>
</body>
</html>

That is nice javascript, I understand the DOM objects.
Be honest, you don't understand the first thing about programming.
You've been posting on various programming forums for 18 months and
you still haven't learned a single thing!
 
J

JRough

JRoughwrote:
That is nice javascript, I understand the DOM objects.  I did notice
that you didn't include the method = "post".
Doesn't it need the method "post"?

You are welcome. Yes, it needs method="POST" because the default
method is GET. I must be accidentally deleted it when correcting the
code.
Thank you for noticing the curly
quotes.  I found a setting for straight quotes.  It is a desktop
database and I guess that was like a typing program.

You may play around with that simple script below. Make a copy and
torture it in any imaginable way :) to feel yourself more comfortable
with JavaScript

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type"
content="text/html; charset=iso-8859-1">
<title>Test</title>
<script type="text/javascript">
function test(elm, frm) {
 var out = frm.output;
 var p = '';
 for (p in frm) {
  out.value+= p+' = '+frm[p]+'\n';
 }}

</script>
</head>
<body>
<form name="myForm" action="">
<textarea name="output"
 cols="60" rows="10"></textarea>
<br>
<input type="button" value="Test"
 onclick="test(this, this.form)">
</form>
</body>
</html>

I will play around with it. I just started learning Javascript in
order to get this form to work. Thanks again. I have been trying to
get this web services that involves Google maps to work and all that
is needed is this Javascript. Actually C.P. is correct I don't know
much about Javascript but after I work on this along with the other
one earlier I will understand it. :)
 

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

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top