Link to home
Start Free TrialLog in
Avatar of bfuchs
bfuchsFlag for United States of America

asked on

Modify JavaScript code to add a button.

Hi Experts,

I am taking over a datapage designed in Caspio.
The datapage has the following code in a HTML Section.

<span class="action-[@field:GUID]" style="display:none;"></span>

<script>

$('td[class^="cbResultSetActionCell"] a:nth-of-type(2)').removeClass();
$('td[class^="cbResultSetActionCell"] a:nth-of-type(2)').addClass('btn btn-primary');

if ('[@field:Status]' != 'Completed') {

$('.action-[@field:GUID]').closest('tr').find('td[class^="cbResultSetActionCell"]').append('<a href="./edit-snvn.php?ID=[@field:GUID]" class="btn btn-primary">Edit</a>');

}
</script>

Open in new window


Now I want to add a button in case of status being "completed" that will open another datapage, similar to what the edit button does above.

How can I accomplish it?

Attached is the PHP file.

Thanks
snvn-report-EE.php
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bfuchs

ASKER

Thank you!