JSON - Bind variable for dynamic URL

0 votes
194 views
added Feb 14, 2018 in API by LC Marshal Captain (25,790 points)
edited Jul 13, 2018 by LC Marshal
var asset = select_asset,  
    property_type = $('#property_type option:selected').val(),
    sub_type = $('#sub_type option:selected').val(),
    block = $('#block').val(),
    level = $('#level').val(),
    built_up = $('#built_up').val(),
    built_up_nl = $('#built_up_nl').val(),
    land_area = $('#land_area').val(),
    username = $('#username').val(),
    email = $('#email').val(),
    contact = $('#contact').val(),
    submitUrl = '';

    submitUrl = "https://google.com/add";
    submitUrl += "?asset_id="+asset;
    submitUrl += "&property_type="+property_type;
    submitUrl += "&sub_type="+sub_type;
    submitUrl += "&block="+block;
    submitUrl += "&level="+level;
    if (property_type == 'l'){
      submitUrl += "&built_up="+built_up;
    }
    else {
      submitUrl += "&built_up="+built_up_nl;
    } 
    submitUrl += "&land_area="+land_area;
    submitUrl += "&username="+username;
    submitUrl += "&email="+email;
    submitUrl += "&contact="+contact;
    submitUrl += "&state="+ select_state;
lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...