Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Confirmation on Custom Task 23 Nov 2016 10:13 #14727

Hi,
I am having some trouble getting a confirmation popup working on a custom task. Any help appreciated.

It is in the Item View. When a user clicks "Submit" I would like a message to pop up to say "Are you sure you wish to Submit...?" - just like the Delete task works.



In my fork/views/_item/view.html.php file I have added this javascript....
<script type="text/javascript">
			Joomla.submitform = function(task)
			{
				if (task == 'device_item.submitdevice')
				{
					if (confirm(Joomla.JText._('Are you ready to Submit this device? It will then become locked.'))) {
						Joomla.submitform(task);
					} else {
						return false;
					}
				}
			}
		</script>





This is the line that creates the toolbar button...
// Submit
		JToolBarHelper::custom('device_item.submitdevice', 'cog', 'cog', "TEST_JTOOLBAR_SUBMIT", false);

. Thanks for any help - this has been driving me nuts all day :pinch:
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Confirmation on Custom Task 02 May 2017 12:48 #15091

Bump - any ideas on this?

Cheers
Just call me Chris :)

Please Log in or Create an account to join the conversation.

Confirmation on Custom Task 03 May 2017 12:07 #15099

Are you sure you even need a custom task?

I used this in a publish button on a previous component that should work
<li class="btn btn-small " style="list-style:none; " id="toolbar-jobs.publish" onclick="if (document.adminForm.boxchecked.value==0){alert('Please first make a selection from the list.');}else{if (window.confirm('You are about to publish this job. Once listed you can only cancel the job to remove it. Are you sure you want this job to be listed?  ?'))return Joomla.submitform('jobs.publish');}">
	
<div class="" style="cursor:pointer">
		
<i class="icon-publish icomoon"></i>
		
<span class="text" style="white-space:nowrap">Publish</span>

	
</div>
</li>

You can obviously add parts of this to a button rather than a <LI> if you want but the principal is sound
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla
The following user(s) said Thank You: organicwebs

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.076 seconds

The j-cook project is one of the best of its kind and it is nice that we all try to contribute in little ways to make life easy for each other.

vlemos (Forum)  

Get Started