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
how to pass text set in a javascript? [message #178857] Wed, 15 August 2012 03:51 Go to previous message
thejustpark is currently offline  thejustpark
Messages: 5
Registered: August 2012
Karma:
Junior Member
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.
[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: Thu Nov 28 00:21:25 GMT 2024

Total time taken to generate the page: 0.05560 seconds