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

SanjivMeher
Kilo Patron
Kilo Patron

I dont see any issue. Do you have the right variable name?

Are you testing on portal. If yes, do you have the UI type set to all?


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

How do I check the UI type?

In the client script form itself

SanjivMeher_0-1716509673137.png

 


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

That didnt work. and i deleted and readded the variables, but still running into same error. Any other pointers?