"write confirm dialog box if yes then run function using php" Code Answer's
You're definitely familiar with the best coding language Javascript that developers use to develop their projects and they get all their queries like "write confirm dialog box if yes then run function using php" answered properly. Developers are finding an appropriate answer about write confirm dialog box if yes then run function using php related to the Javascript coding language. By visiting this online portal developers get answers concerning Javascript codes question like write confirm dialog box if yes then run function using php. Enter your desired code related query in the search bar and get every piece of information about Javascript code related question on write confirm dialog box if yes then run function using php.
write confirm dialog box if yes then run function using php
You can handle the attribute onClick for both i.e. 'ok' & 'cancel' condition like ternary operator
Scenario: Here is the scenario that I wants to show confirm box which will ask for 'ok' or 'cancel' while performing a delete action. In that I want if user click on 'ok' then the form action will redirect to page location and on cancel page will not respond.
So below code is working properly for me :
onClick="return confirm('Are you sure you want to Delete ?')?this.form.action='<?php echo $_SERVER['PHP_SELF'] ?>':false;"
Full code
<input type="submit" name="action" id="Delete" value="Delete" onClick="return confirm('Are you sure you want to Delete ?')?this.form.action='<?php echo $_SERVER['PHP_SELF'] ?>':false;">
And by the way I'm implementing this code as inline in html element using PHP. so that's why I used 'echo $_SERVER['PHP_SELF']'.
I hope it will work for you also. Thank You
Source: stackoverflow.com
All those coders who are working on the Javascript based application and are stuck on write confirm dialog box if yes then run function using php can get a collection of related answers to their query. Programmers need to enter their query on write confirm dialog box if yes then run function using php related to Javascript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about write confirm dialog box if yes then run function using php for the programmers working on Javascript code while coding their module. Coders are also allowed to rectify already present answers of write confirm dialog box if yes then run function using php while working on the Javascript language code. Developers can add up suggestions if they deem fit any other answer relating to "write confirm dialog box if yes then run function using php". Visit this developer's friendly online web community, CodeProZone, and get your queries like write confirm dialog box if yes then run function using php resolved professionally and stay updated to the latest Javascript updates.