Peter Kroman
asked on
Binding a link
Hi,
I have this page: http://kroweb.dk/gfdev/godser_raw2/
I am trying to bind the two input fields in the form at the top to the link so that the values for column 2 and column 4 goes in the first and second text field respectively. When this works this form will be hidden.
After that I need the two fields to perform a search on the collecting page the links opens.
I have actually got this working on other pages, but for some reason this is not working on this page, and I really don't understand that.
If you want to test it you can write "Kronborg" in the main searchfield (labeled "Søg") on the page, then you will get a table with links in the "Sogn" column that you can click on :)
I have this form (later not displayed):
And I have this js:
Anybody who can help here?
I have this page: http://kroweb.dk/gfdev/godser_raw2/
I am trying to bind the two input fields in the form at the top to the link so that the values for column 2 and column 4 goes in the first and second text field respectively. When this works this form will be hidden.
After that I need the two fields to perform a search on the collecting page the links opens.
I have actually got this working on other pages, but for some reason this is not working on this page, and I really don't understand that.
If you want to test it you can write "Kronborg" in the main searchfield (labeled "Søg") on the page, then you will get a table with links in the "Sogn" column that you can click on :)
I have this form (later not displayed):
<form id="search" style="display:block" target="_blank" method="GET">
<input type="text" name="sogn" id="sogn">
<input type="text" name="amt" id="amt">
</form>
And I have this js:
$('#list_items').on('click', '#tdata tr > td:nth-child(2) a', function(e) {
e.preventDefault();
$('#sogn').val( $(this).parents('tr').find('td:eq(1)').text() );
$('#amt').val( $(this).parents('tr').find('td:eq(3)').text() );
$('#search').attr('action', $(this).attr('href') );
$('#search').trigger('submit');
});
Anybody who can help here?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot leakim971. I have struggled with this one for several days now. Now it works :)