Atchett
Programmer
- Dec 7, 2000
- 35
Hi,
Can anyone help me with this problem?
I am trying to submit a form. Firstly I am checking wether there is something in the text area, if not put in the message (which works fine) and then depending on which link was clicked it submits a different value for the next page to use in searching different databases.
<SCRIPT LANGUAGE="JavaScript">
<!--
var errMsg = "Please enter your text here";
var newAction, formActionResult;
function doFunctionStuff(formAction)
{
if (document.form.query.value == "" || document.form.query.value == errMsg) {
document.form.query.value = errMsg;
bClearTextField = true;
}
else
{
newAction = formAction;
formActionResult = "Page.asp?Test=" + newAction
document.form.action = formActionResult
document.form.submit();
}
}
//-->
</SCRIPT>
The link I am using to submit:
<a href="javascript:doFunctionStuff('BitIWantInURL');">Some Link</a>
The form will submit to the Page.asp page and it will also submit what is in the text box but it won't submit the Test= part.
I realise it's probably something simple!!
Many thanks,
JB
Can anyone help me with this problem?
I am trying to submit a form. Firstly I am checking wether there is something in the text area, if not put in the message (which works fine) and then depending on which link was clicked it submits a different value for the next page to use in searching different databases.
<SCRIPT LANGUAGE="JavaScript">
<!--
var errMsg = "Please enter your text here";
var newAction, formActionResult;
function doFunctionStuff(formAction)
{
if (document.form.query.value == "" || document.form.query.value == errMsg) {
document.form.query.value = errMsg;
bClearTextField = true;
}
else
{
newAction = formAction;
formActionResult = "Page.asp?Test=" + newAction
document.form.action = formActionResult
document.form.submit();
}
}
//-->
</SCRIPT>
The link I am using to submit:
<a href="javascript:doFunctionStuff('BitIWantInURL');">Some Link</a>
The form will submit to the Page.asp page and it will also submit what is in the text box but it won't submit the Test= part.
I realise it's probably something simple!!
Many thanks,
JB