calling vbScript function from button input type

大憨熊 提交于 2021-02-11 13:58:39

问题


I have the following function declared in the tag of a classic asp page that i did not write but need to edit;

<SCRIPT language="VBScript">
sub confirmuser(sSubtype, sAction)

    ' this prompts user to confirm their action and sets hidden form fields.
    ' current subtypes are 1) Free Trial 2) Equity 3) Mutual Funds.
    ' current actions are 1) subscribe 2) unsubscribe

    sConfirmMessage = "Clicking on the OK button below will " & sAction & " login <%=rtrim(session("WebID"))%> " & _
        "to the " & sSubtype
    if sSubtype = "Free Trial" then
        sConfirmMessage = sConfirmMessage & "."
    else
        if sAction = "subscribe" then
            sConfirmMessage = sConfirmMessage & " Research Package at the stated rates.  This charge will appear " & _
            "on your commission statement."
        else
            sConfirmMessage = sConfirmMessage  & " Research Package."
        end if
    end if

    ' if they click OK, then they want to go ahead and process.  Save the necessary info
    ' in the two hidden form fields and post the form.
    if msgbox(sConfirmMessage, VBOKCancel, "Please Confirm") = 1 then
        window.frmSub.subType.value = sSubType
        window.frmSub.action.value = sAction
        window.frmSub.submit()
    end if

end sub


</SCRIPT>

and in HTML input that is trying to execute the function;

<CENTER><INPUT type='button' value='Sign Up' id='subaction' name='subAction' language='VBScript' onclick="vbscript:confirmuser('Equity','subscribe')"></CENTER>

when trying to click the button i receive the error of;

"Uncaught ReferenceError: confirmuser is not defined"

this functionality currently is working in the website, so i don't know why I am receiving these errors, but I am no classic asp/vbscript guru so i was hoping someone could help me out.

来源:https://stackoverflow.com/questions/27253420/calling-vbscript-function-from-button-input-type

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!