3 messages in com.googlegroups.google-gadgets-apiQuestion about appending form submits
FromSent OnAttachments
krisguy17 Mar 2006 13:37 
Daniel C. Silverstein17 Mar 2006 19:28 
krisguy17 Mar 2006 20:37 
Subject:Question about appending form submits
From:krisguy (kris@gmail.com)
Date:03/17/2006 01:37:51 PM
List:com.googlegroups.google-gadgets-api

I'm new to programming in general, so I'm confused about forms to begin with.

What I'm trying to do is take a server name stored as a variable, and append that with the search term from a form, then open a new window with a URL made from the variable and the search word.

// This is to store the Site pref as a variable var lookupsite__MODULE_ID__ = prefs.getString("site");

// Here's an example of the form without submit functions <form id="wordentry__MODULE_ID__" style="text-align:center"> <input id="lookup_word__MODULE_ID__" type="text" name="text"> <input type="Submit" name="lookup" > </form>

I'm not sure what would be easier, make a JavaScript function and have it called from the form element, or change it from a submit button to a regular button and have it do an onClick function.

I've tried it both ways, and here is what I've got for the function right now. The alert line will be changed to a window.open style line.

function sendWord(form) { var word__MODULE_ID__ = form.inputbox.value; var URL__MODULE_ID__ = lookupsite__MODULE_ID__ + word__MODULE_ID__; alert ("URL is" + URL__MODULE_ID__); }

Anything else Google API related I'm forgetting either?