How to submit form by clicking on hyperlinks
Hi there,
I've an <a href="a">A</a> and <a href="b">B</a>. I want to know which letter user cliked on so that I can run a database query.
How can I do this. Any ideas?
Thanks
Joe Green
Hi there,
I've an <a href="a">A</a> and <a href="b">B</a>. I want to know which letter user cliked on so that I can run a database query.
How can I do this. Any ideas?
Thanks
Joe Green
This is not really a ColdFusion issue, rather a Javascrip/HTML question, unless you want to do a background Ajax query with CF.
Anyway, I would trigger javascript events, filling up a hidden form field with either "a" or "b", then submitting the form.
In the style of:
<a href="javascript:document.getElementById('myhiddenformfield').value='a';document.getElementById('myform').submit();">A</a>
<a href="javascript:document.getElementById('myhiddenformfield').value='b';document.getElementById('myform').submit();">B</a>
<cfform name="myform" id="myform" method="post" action="...">
<cfinput type="hidden" name="myhiddenformfield">
...
</cfform>
Hope this helps?
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.