| |

VerySource

 Forgot password?
 Register
Search
View: 674|Reply: 3

The web interface has a button. Press Enter to not submit the form. Click the button to submit.

[Copy link]

1

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-8 19:30:01
| Show all posts |Read mode
The web interface has a button. Press Enter to not submit the form. Click the button to submit.
Reply

Use magic Report

0

Threads

26

Posts

20.00

Credits

Newbie

Rank: 1

Credits
20.00

 China

Post time: 2020-5-31 02:30:01
| Show all posts
Write a function in the script to determine whether to press the Enter button, if it is pressed, then execute an empty code.
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-4 11:30:01
| Show all posts
Don't use "submit" type buttons, use "button" type buttons
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-6-5 11:45:01
| Show all posts
If you want to return without submitting, use type=button

If you want to press Enter to submit, let the button's onkeydown=KeyDown()

<script language="javascript">
function KeyDown()
{
    if (event.keyCode == 13)
    {
        event.returnValue=false;
        event.cancel = true;
        Form1.btnsubmit.click();
    }
}
</script>
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list