querying a hidden field in admin page

248 Views Asked by At

I have 2 hidden fields called hdnBrId and hdnCmdAction. I set them with javascript calls from their grid row cells eg hdnCmd is set to "Edit" and the row id is set similarly. and then a post from jquery

When i try query their values (before the if or before any javascript) (even with an echo) eg echo $_POST['hdnCmd'];
I get nothing and if($row->BrId == $_POST["hdnBrId"] and $_POST["hdnCmd"] == "Edit")
{ echo "in edit mode"; obviously is not working.

Anybody know what to here ? thx

1

There are 1 best solutions below

0
On

Basically it seems on "submit" or "postback" because of the stateless nature of web, it will be lost, though it should still be query-able before resubmitting to the browser,...using $_POST["hdnThingy"]. Here, what happened was they were not being set correctly.

to do so correctly (in this case, I generate a html table of rows with db data and..

<input  type="hidden" name="hdnThingy" id="hdnThingy" **value="<?php echo $Sel;?>"** > 

I use id and name as there is some javascript and jQuery script which interrrogates these hidden fields for different reasons.