• I’m stumped… I have a field (fieldname6) that sometimes outputs the results: 1/0, 2/0, 3/0, and 4/0.

    I have created a series of if statements to tell the next calculated field what to do with those specific values (bottom 4 if statements below)

    When I run this; it seems like the forward slash of the if statement is messing up the value so instead of returning 1/0, the calculated field is returning 1. Instead of returning 2/0, the calculated field is returning 2.

    How can I have the if statement interpret “1/0” literally?

    I’ve tried backslashes and quotation marks to no success; but it’s likely I’m just doing it wrong.

    (function(){
    
    (function(){
    var link = '';
    
    if(fieldname6 == 18) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 18 AWG Wire</a>';
    
    if(fieldname6 == 16) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 16 AWG Wire</a>';
    
    if(fieldname6 == 14) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 14 AWG Wire</a>';
    
    if(fieldname6 == 12) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 12 AWG Wire</a>';
    
    if(fieldname6 == 10) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 10 AWG Wire</a>';
    
    if(fieldname6 == 8) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 8 AWG Wire</a>';
    
    if(fieldname6 == 6) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 6 AWG Wire</a>';
    
    if(fieldname6 == 4) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 4 AWG Wire</a>';
    
    if(fieldname6 == 2) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 2 AWG Wire</a>';
    
    if(fieldname6 == 1) link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 1 AWG Wire</a>';
    
    if(fieldname6 =="1/0") link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 1/0 AWG Wire</a>';
    
    if(fieldname6 == "2/0") link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 2/0 AWG Wire</a>';
    
    if(fieldname6 == "3/0") link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 3/0 AWG Wire</a>';
    
    if(fieldname6 == "4/0") link = '<a href="https://amzn.to/2NZR2Dx" target="_blank" rel="noopener noreferrer">Click Here to shop 4/0 AWG Wire</a>';
    
    jQuery('.result-here').html(link);
    })()
    
    })();
  • The topic ‘Escaping forward slashes’ is closed to new replies.