q show the properties of text boxthe ampltinputgt


Q. Show the properties of Text Box?

The <INPUT> tag is used to specify where user input is expected. It has several attributes, of which TYPE attribute is used to specify the kind of input which is to be provided. The most common value of this attribute of <INPUT> tag is TEXT. As demonstrated in Figure, every INPUT needs a NAME. When user types in his address (for instance 1234 ABC), it will become input's value and be paired with NAME so end result after running it through Mailto Formatter would be ADDRESS=1234 ABC.

We can, if we want to, type in a VALUE.

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 XYZ">

This would automatically pair the value 44 XYZ with name ADDRESS, unless user changes it. Take care to use quotes as specified in the illustration.

We can specify the size of text input box.

<INPUT TYPE=TEXT NAME="ADDRESS" VALUE="44 XYZ" SIZE=10>

Default value is 20. You already know that default value is the value that browser presumes if you haven't told it otherwise.

Go ahead and remove VALUE="44 XYZ".

If we want, we can specify how many characters a user can input.

Experiment with this and try to input more than 10 characters! MAXLENGTH attribute is used to restrict number of characters to be entered in textbox.

<INPUT TYPE=TEXT NAME="ADDRESS" SIZE=20 MAXLENGTH=10>

Very similar to TYPE=TEXT is the TYPE=PASSWORD. It is exactly same, except that for security it displays *** in place of the actual input. Text entered as password wouldn't be echoed on the page. So you can use this anytime you want to accept a password or some other sensitive information from the user.

<INPUT TYPE=PASSWORD>

Remember that every <INPUT> should have a NAME which gives the name of field.

<INPUT TYPE=PASSWORD NAME="USER PASSWORD">

SIZE, VALUE and MAXLENGTH attributes work here also similarly as they do with TEXT.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: q show the properties of text boxthe ampltinputgt
Reference No:- TGS0333173

Expected delivery within 24 Hours