Simple tip of beautifying the File form

xiaoxiao2021-04-06  281

I saw someone asked a "I saw a" ""

How to click on a page button to pop up a path selection dialog box, a friend gives a better solution, can be called "JS event". The code is as follows:

<

INPUT

Type

= "Button"

Value

= "SELECT"

Onclick

= "path.click ()"

/>

<

INPUT

Type

= "file"

id

= "PATH"

Style

= "Display: none;"

/>

It actually hides the original File form, because the File form button style cannot be changed, here is used instead of the File button. You can transfer the file's Click event to Button. You can then simulate a Text box instead The text box in File can then beautify it. You can do a smart method for beautifying the File form. Casual thinking .... According to the vision of the coupon:

DOCTYPE HTML PUBLIC "- // w3c // DTD HTML 4.0 Transitional // En"

>

<

HTML

>

<

HEAD

>

<

Title

>

New document

Title

>

<

Meta

Name

= "Generator"

Content

= "Editplus"

>

<

Meta

Name

= "Author"

Content

= ""

>

<

Meta

Name

= "Keywords"

Content

= ""

>

<

Meta

Name

= "Description"

Content

= ""

>

HEAD

>

<

Body

>

<

INPUT

Type

= "text"

Size

= "20"

Name

= "Upfile"

id

= "Upfile"

Style

= "Border: 1px dotted #ccc"

>

<

INPUT

Type

= "Button"

Value

= "Browse"

Onclick

= "path.click ()"

Style

= "Border: 1px solid #ccc; background: #fff"

>

<

INPUT

Type

= "file"

id

= "PATH"

Style

= "Display: none"

ONCHANGE

= "Upfile.Value = this.Value"

>

Body

>

HTML

>

转载请注明原文地址:https://www.9cbs.com/read-132350.html

New Post(0)