button disappeare after submit in detail view

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
ushay
Veteran Member
Posts: 54
Joined: 2020-06-26 21:30

button disappeare after submit in detail view

Post by ushay » 2022-06-29 20:01

hello,

i have managed to add a button that send a mail in detail view.
the code is placed in footer-extras.php.
my problem is that the button disappeare after the operation finished.
can you please help?

here is the code:

Code: Select all

<script>
	
		
		$j('[id$=dv_action_buttons] .btn-toolbar').append(
			'<div class="btn-group-vertical btn-group-lg" style="width: 100%;">' +
				'<input type="submit" value="Send Mail"  name="submit" class="btn btn-default btn-lg">' +	
			'</div>'
		);	
	
		 <?php
		 
		if(isset($_POST['submit'])){
		$mail = [
		"to" => "[email protected]",
		"name" => "test",
		"message" => "Test-message (1)",
		"subject" => "Test-subject (1)",
		"debug" => 4
		];

		sendmail($mail);
		
    }
	
		?>
		
</script>


Post Reply