variable value not being set correctly when submitting catalog item

Saquib Mohammed
Mega Guru

I have a client script that checks the value of a Yes/No variable and then checks whether attachment was added in the script on submission.

 

function onSubmit() {
   var condition_4 = g_form.getValue('have_attached');
   alert('Value of condition 4', + condition_4);
if (condition_4 == 'Yes' {
//Here is code for attachment check//
}
 
On submitting the form, the alert is just displaying "alue of condition 4'" - There is no value in it. 
Can someone tell me what might be the reason?

 

8 REPLIES 8

Would you be able to share a full screenshot of the catalog client script?


Please mark this response as correct or helpful if it assisted you with your question.

Rishayshandilya
Tera Contributor

Can you share the client script 

Abhit
Tera Guru

@Saquib Mohammed 

Is that variable visible on the form, while submitting the request?

Rishayshandilya
Tera Contributor

Hi You are not using alert correctly

alert('Value of condition 4'+ condition_4);

remove that comma

 

I think I solved your issue