Submitting to variable pages in html form

37 views Asked by At

Hullo, I am trying to post a form to variable pages by storing them in a cookie. All seems to work fine, but for the target. When I use the following code the target of the post operation remains the current page, albeit I set the target both in the form and explicitly in the function. What is wrong in what I did?

<script>
 function submit(form){
    var table=leggiCookie("source");
    form.target='_parent';
    form.action = "/combustibili/"+table+".php";
 }
</script>
</head>
<body>
<form name='request' method='post' target='_parent' onsubmit="submit(this);">
</form>
0

There are 0 answers