Alphamonkey
08-28-2007, 03:49 AM
I want to have it so when a button is pressed in a form, to change that form's action
heres the javascript
function change2delete(name)
{
document.name.action='deletesong.php';
}
and relevant html
<form name='{$row['name']}' method='post' action='editsong.php' enctype='multipart/form-data'>" .
<input type='submit' name='button' id='button' value='Edit'>
<input type='submit' name='delete' id='delete' value='Delete' onclick='change2delete({$row['name']})'>
</form>
there is nothing wrong with the $row['name'], i have left out my mysql conncetion and testing to see if they all contain values
heres the javascript
function change2delete(name)
{
document.name.action='deletesong.php';
}
and relevant html
<form name='{$row['name']}' method='post' action='editsong.php' enctype='multipart/form-data'>" .
<input type='submit' name='button' id='button' value='Edit'>
<input type='submit' name='delete' id='delete' value='Delete' onclick='change2delete({$row['name']})'>
</form>
there is nothing wrong with the $row['name'], i have left out my mysql conncetion and testing to see if they all contain values