Syntax Error when using jQuery Selector on ID's with colons

115 views Asked by At

I am currently using ALV to validate forms on my visualforce page. As a result of visual force, all the ID's have colon's in them which I assume is causing the error

Uncaught Error: Syntax error, unrecognized expression: CreationPageBlock

on an id that looks like

CreationPage:CreationPageBlock:[otherthingshere]

Here is my code at the moment. I have tried various things from escaping the colon (using backslashes), to using getElementByID, to using the '[id='']' format, however I keep getting the same error every time I click anything on my visualforce page.

EDIT: Here is my updated code, still having the same issue however

$(function(){

    $('#CreationPage\\:CreationPageBlock\\:getOffering\\:troubleCode').alv();

});


<!--FormSubmit-->       
$('#CreationPage\\:CreationPageBlock\\:getOffering\\:getOfferingsButton').alv('validateForm',{
        formsToSubmit:'#CreationPage\\:CreationPageBlock\\:getOffering',
        formSuccess:function(){
            alert("SUCCESS");
        },
        formFail:function(){
            alert('MUCHFAIL');
        }
    });

EDIT#2: I understand this looks like a duplicate, but I have tried all the suggestions from the other posts but nothing seems to work which is why I posted the question here

0

There are 0 answers