Need to cancel submit a form using glide ajax

amit164
Giga Contributor

when a user enter a short description which is already exists,then form submission should aborted.

i am using on submit client script and glide ajax.

all i want to cancel sumission on the basis of result from script include.

how is it possible plz suggest

1 ACCEPTED SOLUTION

Hi,

If you used same then you should mark my response as correct.

But anyway what important here is solution to your query and you got that.

Thanks,

Dhananjay.

View solution in original post

14 REPLIES 14

harishdasari
Tera Guru

Hi Amit,

You can use the client script for this.

write the On-Submit client script.

var shor_desc = g_form.getValue('short_description');

if(newValue == shor_desc )
{
alert('Cannot submit the form with same short description');
return false;
}

Script include will be used if you want to retrieve any of the values from the different table and set those values on any of the fields then we should use to glide-Ajax and script include.

In your current requirement there is no necessity of using the script include.

Thank you.

 

newvalue cannot be used in onsubmit

Priya Shid1
Kilo Guru

Hi Amit,

i would like to suggest that It is bad practice to use glide ajax with onSubmit Client Script if you are giving asynchronous call to the server.

because it may possible that your form will get submit untill server respond to your request.

 

Please mark if that helps you!!

Hi,

You can check with onChange of short_description give a ajax call and check whether short_description is already present or not and send value accordingly to client side true or false.and if it is present simply clear field value and display appropriate info message.

else you have to make synchronous ajax call .which will hamper performance. 

 

Please mark if that helps you!!