Link to home
Start Free TrialLog in
Avatar of Caiapfas
Caiapfas

asked on

URGENT :::: simple javascript question, I need to change the hidden tag from button push 500points

I need to chage this

<input type="hidden" name="pid" value="updateItem" />

to whatever i want from this button push ..


<input type="submit" value="Delete Item" /> <<< this code can not be changed


Avatar of Rodney Helsens
Rodney Helsens

not sure what you mean by <<this code cannot be changed, but I will assume that you mean you cannot attach an event handler to that button, is this case, you can use the OnSubmit() event of the form to access this hidden field and set its value.


<script>
function dosomething()
{
document.forms["myform"].pid.value = "whatever I want";
}
</script>

<form name="myform" onSubmit="dosomething();">

<input type="hidden" name="pid" value="updateItem" />

<input type="submit" value="Delete Item" />

</form>
Avatar of Caiapfas

ASKER

yes the event handler can be in the button and has to be since there are 5 buttons on this page..pleaseh help asap
ASKER CERTIFIED SOLUTION
Avatar of PodExpert
PodExpert

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of raj3060
Has this question been answered??
I suppose so.