You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by "F. Da Costa Gomez" <dc...@fixed.com> on 2003/04/30 15:33:33 UTC

Submit Form via JS & onsubmit="..."

Hi,

I was wondering about the operation of the following two snippets

<form jwcid="@Form" name="Form2"
 	listener="ognl:listeners.objectSelectorListener"
 	onsubmit="javascript:this.selectedUUID=t1.getSelected().UUID;">
 <input jwcid="selectedUUID@Hidden" type="hidden" name="selectedUUID" 
value="ognl:UUID" />
</form>

function addObject(){
	if (t1.getSelected()) {
		var params = new Array(2);
		params[0] = "new";
		params[1] = t1.getSelected().UUID;
		document.Form2.selectedUUID.value = params[1];
		document.Form2.submit();
	} else {
		alert("Please select a mother category and re-submit");
	}		
}

If addObject() is called from where-ever I would expect it to take a hold 
of Form2 and actually submit it prior to finishing the task of the caller. 
Is this a save assumption or am I overlooking something?

TIA,
Fermin DCG

-- 
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/