I would like to pass values in anchoring.
Keeping it visible I can use <a href=xyz.php?ID=123&action=delete>

In above I would like action=delete to be hidden. What to do?

I cannot use input type=hidden as I'm not submitting the form.instead requires onclick by clicking on reference page in anchoring and passing the hidden values in URL.

Can't I use <a href="xyz.php?ID=123&<?php <input type=hidden name='action' value='delete'>">

Recommended Answers

All 5 Replies

Use ajax to call the xyz.php

following is the sample,
you can have 2 forms and onclick you can use javascript fuction to post your values to xyz.php.

<script lang='javascript'>
function delete_record(id,act)
<form name='actionform' id='actionform' action='xyz.php' method='post'>
<input type='hidden' name='ID' id='ID'>
<input type='hidden' name='action' id='action'>

<form name='mainform' id=mainform action='somepage.php'  method='post'>
rec 1<a onclick="javascript:delete_record(123,'delete');">Delete</a><br>
rec 2<a onclick="javascript:delete_record(124,'delete');">Delete</a><br>
rec 3<a onclick="javascript:delete_record(125,'delete');">Delete</a><br>
commented: Useful post +7

Then I used the same method fr action=edit.

function editRecord()

<form name="actionEdit" id="actionEdit" action="./abc.php?page=xyz" method="post">

   <input type="hidden" name="action" id="action" value="edit" />


It doent submit the** action=edit**. Where am I wrong?

please post the screen shots it will be help us....

You're using POST method, not GET. How you receive that "action" $_GET will not get any value from the form. It should be $_POST;

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.