Client Scripts

RaviSanker542
Tera Contributor

RaviSanker542_0-1702018498718.png

I have written an onsubmit client script with alret box
I dont want the dev address 
How can I remove it...??

 

4 REPLIES 4

Kavita_Bhojane
Tera Guru

@RaviSanker542 

 

You can use prompt instead of alert.

 

Please mark my answer helpful and accept as a solution if it helped 👍✔️

Thanks,
Kavita Bhojane

 

Kristen Ankeny
Kilo Sage

that isn't possible as far as I know - instead you would need to leverage a UI page for that alert.

Stefan Georgiev
Tera Guru

Hello @RaviSanker542 ,
as @Kristen Ankeny said this is not possible, this is an OOTB browser UI. The best you can do, if you don't want to invest the time in UI page is just to put a mandatory check box on the form for confirmation, I know that this is not the same, but with one client script, you can add an Info message or something else that suits the purpose.

All the best,

Stefan

Peter Bodelier
Giga Sage

Hi @RaviSanker542 

 

You can use this script:

function onSubmit() {
if (typeof spModal != 'undefined' && !g_form._hasConfirmed) {
		
		spModal.open({
			message: 'Are yous ure to submit this request?', 
			title: 'Confirm',
			buttons: [ 
				{label:'✘ No', cancel: true},
				{label:'✔ Yes', primary: true}
			]
		}).then(function(confirm){
			if (confirm){
				g_form._hasConfirmed = true;
				if (typeof g_form.orderNow != 'undefined') {
					g_form.orderNow();
				} else {
					g_form.submit();
				}
			}
		});
		
		return false;
	}
}

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.