When link is clicked, change checkbox to true on the catalog item

savita Kumari
Tera Contributor

Hi ,

 

Can any one please help to achieve - When link is clicked, change checkbox to true on the catalog item.

I have a form for catalog item , there is a link when the link is not clicked then form should not get submit.

If it is clicked then only user should able to submit the form.

May be we can add a hidden check box , but how to make it true when link is clicked?

 

Thanks,

Savita

 

 

 

 

3 REPLIES 3

Danish Bhairag2
Tera Sage
Tera Sage

Hi @savita Kumari ,

 

What is happening after the link is clicked?

Possible to share some snips to understand much better.

 

Thanks,

Danish

 

Hi Danish,

If link is clicked , its opening another window to show the document, which is correct but , if link is not clicked and user is submitting the form then  it should shows some alert message like 

"Please click the hyperlink before submitting the form"

 

Please note for displaying the link I am using Rich text label

 

Here is the catalog client script -

function onSubmit() {
   //Type appropriate comment here, and begin script below
   var hyperlinkClicked = g_form.getValue('ago_hermesh_doc'); // this is rich text label
   alert("test"+hyperlinkClicked);
 
    if (!hyperlinkClicked) {
                alert('Please click the hyperlink before submitting the form.');
        return false; // Prevent form submission
    }
 
    return true; // Allow form submission
}

 

Thanks

Hi @savita Kumari ,

 

Not sure if it will work or not but u can instead try creating a custom type variable where u can add a widget or macro which will contain ur URL. Then check if u can do a ui poilicy or client script on that variable. or wether u can make it mandatory.

 

Thanks,

Danish