View Full Version : Remove entry from array and repost form

03-16-2009, 01:06 PM
Hi all,

I am trying to accomplish a fairly basic task with javascript > my lack of Js knowledge has meant i have hit something of a roadblock.

I need the a function to take an array from a form, remove the parsed variable from it and repost the form with the new array.

This is what I have so far...

<script language="javascript">

function remove(SID) {

var speakers = document.form_name.elements["SID[]"];
var new_speakers = array();

if( speakers[i].value !== SID) {

new_speakers[] = speakers[i].value;






Please let me know if this is possible and if I'm on the right path.

Any help is very much appreciated!!



Philip M
03-16-2009, 01:34 PM
var new_speakers = new Array();

new_speakers[i] = speakers[i].value;

document.form_name.SID.value = new_speakers; // no brackets necessary

03-16-2009, 03:59 PM
Thanks Phillip.

All sorted now!

Thanks for your help!

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum