I have this fixed now. Here's how you can have any page with a arijdatatable search textbox be set to focus. I'm sure it's not the best way, but it's what it works.
This code grabs the GET variable that shows what article you are viewing. It then checks to see if it matches the one with your table. It then sets the focus to whatever textbox field that you want. eq(0) means the first textbox on the page eq(1) means the second etc.
1. In Joomla turn off "Search Engine Friendly URLs" for a moment so we can see the GET variables that it's using. (Site > Glocal Configuration > Site)
2. Visit the page that your table is on. Look at the URL, you should see at the end that it says "Itemid=". You will be referencing that page by that Itemid number. Put that number in the code below where it says '168'.
3. Download the latest jQuery code from their website and save it to your webroot directory with whatever name you want. In this example I'm calling it jquery.js
4. Edit your index.php file in your web root (/var/
www/<sitename>/index.php). Go to the bottom of the page and paste this php/jQuery code in.
Code: |
<?php
$GetPageIdCustomMod = $_GET["Itemid"];
if($GetPageIdCustomMod == '168')
{
echo"<script type=\"text/javascript\" src=\"jquery.js\"></script>
<script type=\"text/javascript\">
$(function() {
$(\":input:visible:enabled:eq(1)\").focus();
});
</script>";
}
?>
|