Simon336697
asked on
Grabbing posted variables and echoing in a TEXTAREA element
Hi guys hope you are all well.
Guys im having a problem.
I can retrieve tha value of a form variable, but I cannot echo it and display it in a TEXTAREA element.
Should you be able to do this?
When I change the element from a TEXTAREA element to an input type=text box, I can see it.
Im wondering because i thought there was a limit on the number of characters you can have in an input box.
Any help greatly appreciated.
Guys im having a problem.
I can retrieve tha value of a form variable, but I cannot echo it and display it in a TEXTAREA element.
Should you be able to do this?
When I change the element from a TEXTAREA element to an input type=text box, I can see it.
Im wondering because i thought there was a limit on the number of characters you can have in an input box.
Any help greatly appreciated.
ASKER
Hi ban, thank you mate i will right now :>)
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Basically, this is what im having problems with:
showtasks_select_v5.php
posts to
edit_task.php
========================== ========== ========== ===== showtasks_select_v5.php
<form name="formedit" method="post" action="edit_task.php">
<input type="radio" name="radioedittask" value="<?php echo $rows_view_tasks['id_ctk'] ; ?>">
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript ion_ctk']; ?>">
</form>
Just before the above form, I have the following..
========================== ========== ========== ========== ========== ========
<tr>
<td id="viewtasksid"><?php echo $rows_view_tasks['id_ctk'] ; ?></td>
<td id="viewtasksname"><a href="<?php echo $query_string_page; ?>" target="_blank"><?php echo $rows_view_tasks['name_ctk ']; ?></a></td>
<td id="viewtasksproject"><?ph p echo $rows_view_tasks['name_pro ']; ?></td>
<td id="viewtasksdescription"> <?php echo $rows_view_tasks['descript ion_ctk']; ?></td>
<td id="viewtasksradio">
<form name="formedit" method="post" action="edit_task.php">
<input type="radio" name="radioedittask" value="<?php echo $rows_view_tasks['id_ctk'] ; ?>">
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript ion_ctk']; ?>">
</td>
</tr>
====================
Ban, in the above, I can see the following on this page..
<td id="viewtasksdescription"> <?php echo $rows_view_tasks['descript ion_ctk']; ?></td>
So, what I dont understand is when i post to edit_page.php, the following...
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript ion_ctk']; ?>">
and then in edit_page.php try and grab the value of hiddendescription, it is blank.
$grab_hiddendescription = $_POST['hiddendescription' ];
echo "The value of \$grab_hiddendescription is: " . $grab_hiddendescription;
showtasks_select_v5.php
posts to
edit_task.php
==========================
<form name="formedit" method="post" action="edit_task.php">
<input type="radio" name="radioedittask" value="<?php echo $rows_view_tasks['id_ctk']
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript
</form>
Just before the above form, I have the following..
==========================
<tr>
<td id="viewtasksid"><?php echo $rows_view_tasks['id_ctk']
<td id="viewtasksname"><a href="<?php echo $query_string_page; ?>" target="_blank"><?php echo $rows_view_tasks['name_ctk
<td id="viewtasksproject"><?ph
<td id="viewtasksdescription">
<td id="viewtasksradio">
<form name="formedit" method="post" action="edit_task.php">
<input type="radio" name="radioedittask" value="<?php echo $rows_view_tasks['id_ctk']
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript
</td>
</tr>
====================
Ban, in the above, I can see the following on this page..
<td id="viewtasksdescription">
So, what I dont understand is when i post to edit_page.php, the following...
<input type="hidden" name="hiddendescription" value="<?php echo $rows_view_tasks['descript
and then in edit_page.php try and grab the value of hiddendescription, it is blank.
$grab_hiddendescription = $_POST['hiddendescription'
echo "The value of \$grab_hiddendescription is: " . $grab_hiddendescription;
ASKER
Hi mm, in my other page that i use to insert tasks, i just have the following..
<td class="descriptioncol2"><t extarea name="description" type="text" id="description"></textare a></td>
<input type="submit" name="Submit" value="Insert New Task">
Should i be formatting what goes into this textarea section?
<td class="descriptioncol2"><t
<input type="submit" name="Submit" value="Insert New Task">
Should i be formatting what goes into this textarea section?
try
<input type="hidden" name="hiddendescription" value="<?php echo htmlspecialchars($rows_vie w_tasks['d escription _ctk']); ?>">
<input type="hidden" name="hiddendescription" value="<?php echo htmlspecialchars($rows_vie
and for text area the syntax is
<textarea name="description" cols="30" rows="10" id="description"></textare a>
there is no attribute "type" for textarea
you have to format if you are storing it to mysql database, you have to use mysql_real_escape_string()
<textarea name="description" cols="30" rows="10" id="description"></textare
there is no attribute "type" for textarea
you have to format if you are storing it to mysql database, you have to use mysql_real_escape_string()
ASKER
Hi ban,
I am storing it in a mysql database....
You guys are the best...
All i am using at the moment ban is the following for inserting records into mysql:
insert_task.php posts to insert_task_ac.php which inserts the data.....
========================== ========== ========== ========== == insert_task.php
<form name="form1" method="post" action="insert_task_ac.php ">
<textarea name="description" id="description"></textare a></td>
<input type="submit" name="Submit" value="Insert New Task">
</form>
========================== ========== ========== ========== == insert_task_ac.php
$sql="INSERT INTO $tbl_tasks(name_ctk, fk_id_pro_ctk, description_ctk)VALUES('$t askname', '$project', '$description')";
$result=mysql_query($sql);
Ban, how would i incorporate the use of mysql_real_escape_string()
to make sure what the user entered in the textarea wasa "safe" to enter into the database?
You guys have been so generous cant thank you enough.
I am storing it in a mysql database....
You guys are the best...
All i am using at the moment ban is the following for inserting records into mysql:
insert_task.php posts to insert_task_ac.php which inserts the data.....
==========================
<form name="form1" method="post" action="insert_task_ac.php
<textarea name="description" id="description"></textare
<input type="submit" name="Submit" value="Insert New Task">
</form>
==========================
$sql="INSERT INTO $tbl_tasks(name_ctk, fk_id_pro_ctk, description_ctk)VALUES('$t
$result=mysql_query($sql);
Ban, how would i incorporate the use of mysql_real_escape_string()
to make sure what the user entered in the textarea wasa "safe" to enter into the database?
You guys have been so generous cant thank you enough.
ASKER
In insert_tasks_ac.php, im just grabbing the data for the textarea by doing:
$description=$_POST['descr iption'];
$description=$_POST['descr
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks ban and MM......and sorry for doubling up it wont happen again.
Im going to give you guys the points now and work on this some more.
Your help has been invaluable i cant thank you enough.
Im going to give you guys the points now and work on this some more.
Your help has been invaluable i cant thank you enough.
if it's not too late, I'd just give all the points to ban, they did all the conversing, I just asked a question :P
either way, glad you got it all working.
either way, glad you got it all working.
I don't know what is the textarea limit but it is more than 64k.