Only direct script at specific form
-
After your kind help with this issue, I built multiple converter forms for a page on my website.
As advised, I used scripts like the one below in HTML fields.
<script> jQuery(document).on('keydown', '[id*="fieldname2_"]', function(){ editing='mm';}); jQuery(document).on('keydown', '[id*="fieldname3_"]', function(){ editing='inch';}); jQuery(document).on('keydown', '[id*="fieldname4_"]', function(){ editing='metre';}); jQuery(document).on('keydown', '[id*="fieldname5_"]', function(){ editing='foot';}); jQuery(document).on('keydown', '[id*="fieldname8_"]', function(){ editing='yard';}); jQuery(document).on('keydown', '[id*="fieldname10_"]', function(){ editing='km';}); jQuery(document).on('keydown', '[id*="fieldname11_"]', function(){ editing='mile';}); </script>
In the back-end ‘preview’ they all work very well, and they work if placed on a page alone. But they don’t work if they’re on the same page, which I figure is because the “parameter”(?) for the jquery is too broad and is picking up all “fieldname4_[whatever]”.
Is there a way I can focus it only on the form being used?
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Only direct script at specific form’ is closed to new replies.