FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » how to pass text set in a javascript?
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: how to pass text set in a javascript? [message #178858 is a reply to message #178857] Wed, 15 August 2012 04:30 Go to previous messageGo to previous message
Chuck Anderson is currently offline  Chuck Anderson
Messages: 63
Registered: September 2010
Karma:
Member
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
*****************************
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PHPUnit documentation
Next Topic: Create hierarchical tree structure for categories in joomla
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 30 01:04:19 GMT 2024

Total time taken to generate the page: 0.04335 seconds