Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6787
| From | Chuck Anderson <cycletourist@invalid.invalid> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: how to pass text set in a javascript? |
| Date | 2012-08-14 22:30 -0600 |
| Organization | cycletourist.com |
| Message-ID | <k0f8kh$fj7$1@dont-email.me> (permalink) |
| References | <8b54938f-fbc2-4f10-be20-06c36f4fb8ee@googlegroups.com> |
thejustpark wrote:
> In my php page, I have this text area whose text data I want to pass to the php code set in action field.
> Of course, this is working.
> But then, I placed a little button below the text area, so that if a user clicks on it, an example text message gets on there.
> Of course, it is expected that if I click on submit button, this should be able to be passed as data.
> But I find it not working.
>
> OK, let me summarize with a code snippet.
>
> I have the following form.
> <form name="input" action="next.php" method="post" enctype="multipart/form-data" class="SearchForm" target="_self">
> <textarea id="fgData" name="fgData" class="xxlarge" rows="10" disabled="">
> <input type="button" value="Example load" onclick="loadExample();">
> </form>
>
> And loadExample is declared on ahead as in the following:
> <script type="text/javascript">
> <!--
> function loadExample() {
> document.forms["input"].fgData.value = "asdf";
> }
> //-->
> </script>
>
> It actually puts "asdf" on fgData text area.
> However as I click the submit button and echo $fgData;, it doesn't print anything,
> meaning it is not passed over.
>
> What am I missing to pass the data?
>
> Thanking in advance,
> Justpark.
>
Perhaps the superglobal $_POST? You've posted this data to your script,
so look in $_POST['fgData'].
--
*****************************
Chuck Anderson • Boulder, CO
http://cycletourist.com
Turn Off, Tune Out, Drop In
*****************************
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
how to pass text set in a javascript? thejustpark <thejustpark@gmail.com> - 2012-08-14 20:51 -0700
Re: how to pass text set in a javascript? Chuck Anderson <cycletourist@invalid.invalid> - 2012-08-14 22:30 -0600
Re: how to pass text set in a javascript? Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-08-15 08:08 +0200
Re: how to pass text set in a javascript? Denis McMahon <denismfmcmahon@gmail.com> - 2012-08-15 18:30 +0000
Re: how to pass text set in a javascript? Mike Winter <usenet@michael-winter.me.invalid> - 2012-08-15 20:35 +0100
Re: how to pass text set in a javascript? Denis McMahon <denismfmcmahon@gmail.com> - 2012-08-15 21:58 +0000
Re: how to pass text set in a javascript? thejustpark <thejustpark@gmail.com> - 2012-08-15 18:19 -0700
Re: how to pass text set in a javascript? Chuck Anderson <cycletourist@invalid.invalid> - 2012-08-15 20:09 -0600
Re: how to pass text set in a javascript? thejustpark <thejustpark@gmail.com> - 2012-08-15 21:23 -0700
Re: how to pass text set in a javascript? Denis McMahon <denismfmcmahon@gmail.com> - 2012-08-16 08:10 +0000
csiph-web