duandiaoqian5795 2016-08-01 13:54
浏览 69
已采纳

根据下拉选择,将表单7重定向页面重定向到特定URL

My form needs to open a PDF on submit, but which PDF would be determined by one of the dropdown selections.

The dropdown is Download Document (PDF).

Upon clicking Send, I would like the page to open the PDF on submission (preferably in a new tab).

If that is not possible, simply redirecting to the appropriate PDF would suffice.

Can anyone tell me how to do this, please?

My select dropdown is like so:

[select* menu-121 "Spa Track Brochure" "Three Steps To 100% Control" "RFID Pod Range Datasheet" "Tray Tracker Datasheet"]

and the additional settings have the following code:

on_sent_ok: "var pdfsub = $("select[name=menu-121]").val() ; 

if(pdfsub == 'Spa Track Brochure' ){ 
   location = 'your-website1-url'; 
}

if(pdfsub == 'Three Steps To 100% Control ' ){ 
   location = 'your-website2-url'; 
} 
if(pdfsub == 'RFID Pod Range Datasheet' ){ 
   location = 'your-website3-url'; 
}
if(pdfsub == 'Tray Tracker Datasheet' ){ 
   location = 'your-website4-url'; 
}"
  • 写回答

1条回答 默认 最新

  • dongtui9168 2016-08-02 06:15
    关注

    This should work in your case:

    on_sent_ok: "var pdfsub = $("select[name = menu - 121]").val(); 
    
    if (pdfsub == 'Spa Track Brochure') {
        window.open(
            'your-website1-url',
            '_blank'
        );
    }
    
    else if (pdfsub == 'Three Steps To 100% Control ') {
        window.open(
            'your-website1-url',
            '_blank'
        );
    }
    else if (pdfsub == 'RFID Pod Range Datasheet') {
        window.open(
            'your-website1-url',
            '_blank'
        );
    }
    else if (pdfsub == 'Tray Tracker Datasheet') {
        window.open(
            'your-website1-url',
            '_blank'
        );
    }
    "
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?