| |

VerySource

 Forgot password?
 Register
Search
View: 636|Reply: 4

confirm dialog, submit value!

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

Post time: 2020-2-7 17:00:01
| Show all posts |Read mode
Implementation function: After clicking to publish the article, if there is already an article of the same Title, a dialog box will pop up to prompt whether to publish, "OK" and "Cancel", if it is confirmed, the publication is successful, and no action will be taken.
  Consider writing in JS but don't know how the return value of confirm is passed to the server? Is there any other solution?
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-3-29 19:30:01
| Show all posts
Confirm will not submit the return value. If it is determined, the following code will be executed. If it is canceled, it will not be executed. Isn't it good?
Reply

Use magic Report

0

Threads

23

Posts

21.00

Credits

Newbie

Rank: 1

Credits
21.00

 China

Post time: 2020-3-29 19:45:01
| Show all posts
protected void ConFirm (System.Web.UI.WebControls.WebControl wc)
{
wc.Attributes.Add ("onclick", "return confirm ('Are you sure of the current operation?')");
}
In if (! Ispostback)
{
ConFirm (control);
}
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 China

 Author| Post time: 2020-4-8 14:30:01
| Show all posts
Thank you upstairs, but I want to click the submit button, and if there are duplicates in the check, I will prompt again.
You use it mostly for delete operations!
Reply

Use magic Report

0

Threads

2

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 United States

Post time: 2020-4-8 19:00:01
| Show all posts
Write in pageload
Control name. Attributes.Add ("onclick", "return confirm ('Are you sure you want to submit this information');");
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