...

View Full Version : Add target to this form action



DataTalk
12-21-2010, 03:20 PM
Need help adding var target to this form action

Would This be correct?

var form = inp.form;
form.target = "_self";




<html>
</head>
<script type="text/javascript">
function formop(inp,op)
{
var form = inp.form;

form.action = op + ".php";

var temp = inp.id.split(",");
form.id.value = temp[0];
form.FirstName.value = temp[1];
form.LastName.value = temp[2];
}
</script>
</head>
<body>
<form method="post">
<input type="hidden" name="id">
<input type="hidden" name="FirstName">
<input type="hidden" name="LastName">

<input type='image' id='show,me,data' onclick=formop(this,'add'); src='static/icon16/add.jpg'>
<input type='image' id='show,me,data' onclick=formop(this,'edit'); src='static/icon16/edit.jpg'>
<input type='image' id='show,me,data' onclick=formop(this,'delete'); src='static/icon16/delete.jpg'>
</form>
</body>

Old Pedant
12-21-2010, 08:12 PM
Yes, that would work. But "_self" is the default, so there's no need to do that.

DataTalk
12-25-2010, 07:32 AM
Yes, that would work. But "_self" is the default, so there's no need to do that.

I understand that _self is default, I want to target an iframe
action='add.php' target='editor'

Just curious how you would to this?

DataTalk
01-01-2011, 07:26 PM
I understand that "_self" is default.
I need to add a target to the above posted function

I tried this but it did not work?


var form = inp.form;
form.target = "editor";

DataTalk
01-01-2011, 07:29 PM
not sure if the target goes in the submit onclick side or in the function script



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum