No, you can't.
The browser will submit all form fields (input
, select
, and textarea
) to the server, but it won't send any other data.
You need to use Javascript.
SLaks
2010-01-13 01:31:16
No, you can't.
The browser will submit all form fields (input
, select
, and textarea
) to the server, but it won't send any other data.
You need to use Javascript.
You could look for any element having .includeMe
as a class name, and create a form element for it. The next time the form is sent, those items will be sent as values too:
<p class="includeMe" id="state">Georgia</p>
--
$(function(){
// Everything with class 'includeMe'
$(".includeMe").each(function(){
var id = $(this).attr("id"),
text = $(this).text(),
elem = $("<input type='hidden'/>").attr("id", id).val(text);
// Add to form
$("form").append(elem);
});
});
if the problem is with input specifically, then you can use
<textarea name="some_name_to_use_in_php">hello</textarea>