Link to home
Start Free TrialLog in
Avatar of NZ7C
NZ7C

asked on

using input button to control flow (php)

I have a form that displays the results of a search for a user name.  Within that same form I have two buttons which I want to remain side by side. I want each button to take the user to a different action page. Thus if search results show user John Smith - the user can click Edit and go to an edit action page - or he can click Delete and be taken to a Delete action page.  Is there a means of doing this given these requirements? Thanks in advance. In a previous question I asked about preventing  dropiing to the next line after a ending form tag </form>. If it would be possible to prevent that I could then associate an action with each button - but if not is there an answer?


I would like to have the two buttons listed below submit

<input type="submit" class="button" value="EDIT user profile">
<input type="submit" class="button" value="DELETE user">
Avatar of Craig Wardman
Craig Wardman
Flag of United Kingdom of Great Britain and Northern Ireland image

hi, i have posted this in your other question too:

<table>
<tr><td>
<form name="frm1" action="action1.php"><input type="submit" class="button" value="EDIT user profile"></form>
</td>
<td>
<form name="frm2" action="action2.php"><input type="submit" class="button" value="DELETE user"></form>
</td></tr>
</table>
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

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
Hi, as you have mentioned in your other post, you dont want to use tables, you can do it using a quick javascript..

<script language=javascript>
function placeObj(obj_name, next_to){
      var obj=document.forms(obj_name);
      var next_to_obj=document.forms(next_to);

      obj.style.left=next_to_obj.clientLeft+next_to_obj.style.width;
      obj.style.top=next_to_obj.clientTop-43;
}
</script>

<form name="frm1" action="action1.php" id="frm1" style="width: 150"><input type="submit" class="button" value="EDIT user profile"></form>
<form name="frm2" action="action2.php" id="frm2" style="position:relative"><input type="submit" class="button" value="DELETE user"></form>
<img width=0 height=0 src="javascript: placeObj('frm2', 'frm1')">
Avatar of NZ7C
NZ7C

ASKER

Thank you!!!!!!!!!!!!!!!!!!!!