default cursor php field

0

I have this form in php connected to an information in mysql

  

$ contents [] = array ('text' = > '
description
'.   tep_draw_input_field ('description', $ mInfo- > description));
  $ contents [] = array ('text' = > '
Quantity
'.   tep_draw_input_field ('quantity', $ mInfo- > quantity));

I need that when this page enters the cursor is positioned in the field amount of the form., ready to write

How or what command to use so that as soon as it enters the web the cursor is in that field and does not click to write in the

I tried to do this but it does not work:

  

$ contents [] = array ('text' = > '
Quantity:
'.   tep_draw_input_field ('amount', Null, 'autofocus'));

Can I do it with GET? What is the function that I have to insert in the link called?

    
asked by Ivan Diaz Perez 14.04.2018 в 10:28
source

2 answers

1

You can do it with the autofocus attribute of html5.

<input type="text" autofocus >
    
answered by 14.04.2018 в 11:43
1

with this if I work thanks for remembering the autofocus command

  

$ contents [] = array ('text' = > '
Quantity:
'.   tep_draw_input_field ('amount', NULL, 'required   autofocus="autofocus" '));

    
answered by 14.04.2018 в 13:40