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">
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">
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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_nam e);
var next_to_obj=document.forms (next_to);
obj.style.left=next_to_obj .clientLef t+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')">
<script language=javascript>
function placeObj(obj_name, next_to){
var obj=document.forms(obj_nam
var next_to_obj=document.forms
obj.style.left=next_to_obj
obj.style.top=next_to_obj.
}
</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">
<img width=0 height=0 src="javascript: placeObj('frm2', 'frm1')">
ASKER
Thank you!!!!!!!!!!!!!!!!!!!!
<table>
<tr><td>
<form name="frm1" action="action1.php"><inpu
</td>
<td>
<form name="frm2" action="action2.php"><inpu
</td></tr>
</table>