Focus() on tracking number input field when new shipment

Dear.

I would like to have the cursor on the tracking number input field when i create a new shipment.

I ve try to add on the bottom of skin/myskin/admin/view/shipments/components/new_shipment.tpl :



after




When i clear cache.

There are no cursor on the tracking number input field.
Any idea, please?

Try this. Of course, make sure that your input focus line is correctly identifying the input field. I didn’t open the .tpl file to make sure your input part was correct.


```php

{literal}


{/literal}

```

Dear.

Thanks, i modify files, clear cache.

Nothings changed.



I verify input part :




and




I dont understand

Try either



$("#tracking_number").focus();




or



document.getElementById("tracking_number").focus();




instead of



document.shipments_form.shipment_data[tracking_number].focus();

Dear,

Thanks but it doesn’t working.

I just realized that the new shipment information is in an iFrame.


```php

{literal}


{/literal}

```



For my version, 2.0.14, you put the code into the file:

/skins/basic/admin/pickers/shipments_picker_contents.tpl



inside the section right after the code: {include file=“common_templates/scripts.tpl”}



Not sure if 2.1.1 has changed the files for this or not.

Dear,


[QUOTE]/skins/basic/admin/pickers/shipments_picker_contents.tpl[/QUOTE]

This file doesn’t exist on 2.1.1

:confused:

You’ll need to put it into the correct file for your version. The one you listed in your original post is probably the file. Try it, if it isn’t, then look around for the correct file.

I ve tested (end of skin/myskin/admin/view/shipments/components/new_shipment.tpl), no good results.

It works perfect on my version so I’m not sure what is happening wrong on yours. You may want to search the internet for setting focus to inputs within an iframe. Sometimes you need to set focus to the iframe first and then to the input. Since I do not have your version I cannot help much more.

Thanks of lot adodric.

I m looking for…