QuickSearch Auto Focus (onload)

Hi everyone, I’m developing a barcode system in scriptcase how to auto focus the QuickSearch field? both Form application and Grid application.

When the user load a form automatically the cursor will point on the QuickSearch field. I already searched in this forum i tried all suggestions but still i cannnot autofocus on the quicksearch field.

Please advice I’m using the latest version Scriptcase 8.1.

Regards,

Hey Tasio,
It must be an error or something else from Scriptcase but the input field of the quick search has two elements (inside the Toolbar area) with the same Id and that is why when you try to set the focus it does not know which element is referencing. Anyway, in case you would like to set the focus on other element, you have to add the following line in the Javascript OnLoad event of the Form:

document.getElementById(‘id_sc_field_fieldname’).focus();

Where fieldname is the actual name of your field. This would set the focus to that element.

So, as far as this element (the Quick Search input field), that would be a question the Scriptcase, why it does not allow focus if it is for the multiple elements with the same id or if somehow, somewhere they are blurring the focus through other code, jQuery, etc.

Hope this helps.

Regards,

Hi landame thank you very much on your reply, i used your code and apply it to javascript>>form>>onload

At first try its not working but the 2nd try it works, the magic key is to remove the watermark on quicksearch and Boooom! Now working thank you very much for the info.

Hope this help others also.

Hey Tasyo,
Excellent!!, I had my qualms with the watermark but did not have time to test it. Glad to help!!

Best Regards,