How to get SurveyID from javascript

0

Does anyone know how to get to the survey id (“2323232” in this example) dynamically from javascript?

.slider-sgE-2323232-32-473-11345

 

I could grab a bunch of DOM elements and regex to find the ID, but it seems there should be a cleaner way.

Rob Arnold answered
    0

    Much obliged!

    Rob Arnold answered
      2

      Hi Rob!

      I know this is a little late but I grab the survey ID from the div on the page with the class “sg-hidden-inputs” (it’s right under the form element). One of those hidden inputs has the survey id, and you can grab it like this:

      alert($SG(‘#sg_surveyident’).val())

       

      Hope that helps!

      Marybeth answered
        ×

        Login

        Question stats

        • Active
        • Views841 times
        • Answers2 answers
        • Followers1 follower