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.104 seconds

I jumped and started to work on a demo component... but 2 days later this demo component became the real component. I just showed today the end result to my customer and he turned to me and said... "this is more than I expected"... All of this is because Cook did cut about 70% of my work and provided me more ways to improve the usability of the component. The end result was 17 tables all related between than to generate a full dashboard for the travel agents. Thanks for Cook developers for such great tool. This component would not be possible to be done at short time with all the features in it
Griiettner (Forum)  

Get Started