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?