tags:

views:

29

answers:

3

I should send data with form when submit button pressed.This value should be invisible and I used <label name=r_id id=r_id style="visible:hidden"> 1 </div>

This is my form

   <form id="send_message" action="lib/send_message.php" method="post">

    <textarea name="message" cols="45" rows="3" id="message"></textarea>
    <label  name="r_id" id="r_id" style="visible:hidden"> 1 </label>

    <input type="submit" name="Submit" value="Submit"> 
    <input type="reset"    name="Submit2" value="Reset">

But in my .php file It shows only message ,id is empty.

I used $message= $_POST['message'] and $r_ID=$_POST['r_id'] ;

EDIT

I should write that this label value must be change.And I am changing it with Jquery where the mouse clicked it gets tags id.Can I change value attribute with Jquery ?

+3  A: 

You're after a hidden input.

<input type="hidden" name="r_id" value="1"/>
bobince
A: 
input type="hidden"

are made for this and they won't appear if CSS are disabled (but of course they'll still appear in the HTML code)

Felipe Alsacreations
A: 

LABELs are not form elements that can hold or send data. They are captions tied to form elements.

<INPUT TYPE="hidden" name="r_id" id="r_id" VALUE="1"/>

This should do what you want.

thevikas