href submit form with argument
Hi,
I have a form
<form id="multicity_dl_frm_id" name="multicity_dl_frm_name" action="/link" method="post">
which i should submit with <a href=""> link </a>
however there are multiple <a> tags and each should have its own value to submit (id).
<a href=""> link1 </a> <a href=""> link2 </a>
is it possible to submit this POST form with value from href using javascript ?
And values are not the link names, but the ID's (1,2,3,4,...)
So finally when the "link2" is clicked , to submit the form with value "2" for example.
Thanks
hmm you may try
<a href="#" onclick="document.getElementById('multicity_dl_frm_id').action='link?id=1';document.getElementById(' multicity_dl_frm_id').submit();">ID 1</a>
Actually the url should remain the same, and no arguments should be forwarded with ?id (get method)
Maybe <a href="#" onclick="here the code to send ID to submit post form" id="2" > link 2 </a>
?
Thanks
create a hidden field
<input type="hidden" id="id" name="id" />
<a href="#" onclick="document.getElementById('id').value=1;document.getElementById(' multicity_dl_frm_id').submit();">Link 1</a>
hope it works,
That worked !!
Thank you !
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules
Bookmarks