Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #15370
| Path | csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail |
|---|---|
| From | thejustpark <thejustpark@gmail.com> |
| Newsgroups | comp.lang.javascript |
| Subject | how to pass text set in a javascript? |
| Date | Wed, 15 Aug 2012 18:34:57 -0700 (PDT) |
| Organization | http://groups.google.com |
| Lines | 36 |
| Message-ID | <855e4568-1663-4362-8e47-e97873cdd33f@googlegroups.com> (permalink) |
| NNTP-Posting-Host | 98.201.177.84 |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1 |
| X-Trace | posting.google.com 1345081003 891 127.0.0.1 (16 Aug 2012 01:36:43 GMT) |
| X-Complaints-To | groups-abuse@google.com |
| NNTP-Posting-Date | Thu, 16 Aug 2012 01:36:43 +0000 (UTC) |
| Complaints-To | groups-abuse@google.com |
| Injection-Info | glegroupsg2000goo.googlegroups.com; posting-host=98.201.177.84; posting-account=OCQSMwoAAABMMpyKXNaKLZDz4JD4l-mu |
| User-Agent | G2/1.0 |
| X-Received-Bytes | 2166 |
| Xref | csiph.com comp.lang.javascript:15370 |
Show key headers only | View raw
In my php page, I have this text area whose text data I want to pass to the php code set in the action field.
This is working, when I type something in the area.
But then, I placed a little button below the text area, so that if a user clicks on it, an example text gets on there.
Then, I expect that if I click on the submit button, the example text is passed to next.php .
But I find it not working.
OK, let me summarize with a code snippet.
<script type="text/javascript">
<!--
function loadExample() {
document.forms["region"].elements['fgData'].value = "asdf";
alert("asdf");
}
//-->
</script>
<form name="region" action="calculator_sub.php" method="post" enctype="multipart/form-data" target="_self">
<textarea id="fgData" name="fgData" class="xxlarge" rows="10" disabled="disabled"> </textarea>
<input type="button" value="Example load" onclick="loadExample();">
<input type="submit" class="btn primary" id="submit_button" value="Submit">
</form>
The button actually puts "asdf" on fgData text area.
But when I do
<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
?>
in next.php, there isn't even a variable named fgData.
What am I missing to pass the data?
Thanking in advance,
Justpark.
Back to comp.lang.javascript | Previous | Next — Next in thread | Find similar | Unroll thread
how to pass text set in a javascript? thejustpark <thejustpark@gmail.com> - 2012-08-15 18:34 -0700 Re: how to pass text set in a javascript? thejustpark <thejustpark@gmail.com> - 2012-08-15 21:24 -0700
csiph-web