0

EDIT: So this was fixed after obtaining the correct source for my JQuery (the site was trying to play around with it for some reason) and by locating the actual page for the form that is appearing in the iFrame /NewForm.aspx and placing Daniel's code in there. Thank you so much for all of your help Daniel Stölzner, you have been beyond helpful.

What I ended up with:

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

<script>
var $j = jQuery.noConflict();
$j(document).ready(function() {
var select = $j("#ctl00_m_g_7bb989f2_7ca9_456f_b0be_ee0996c38db1_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup")
    select.on("change", function() {
        if (select.find("option:selected").val() == "19") {
            window.location = "http://MYOTHERSITEs/NewForm.aspx"
        }
    })
})
</script>

Original question (incorrect workings removed):- Hi I have a drop down selection in a bubble form for a NewsGator Idea Stream. For business reasons I am not allowed to completely rebuild the site.

This drop down has 15 selections and the form is perfect for 14 of them, the other single selection (PPI) needs additional information. Now I am looking for a simple navigation to another existing site when they choose this single option (i am using workflow solutions to complete this list anyway). I haven't used Jquery before so I'm stuck even trying to trawl through tutorials.

The HTML element can be found below, it is <option value="19">PPI</option> that I am looking to navigate elsewhere on change.

<select name="ctl00$m$g_7bb989f2_7ca9_456f_b0be_ee0996c38db1$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7bb989f2_7ca9_456f_b0be_ee0996c38db1_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup" title="Category">
                <option selected="selected" value="0">(None)</option>
                <option value="6">O1</option>
                <option value="7">O2</option>
                <option value="8">O3</option>
                <option value="9">O4</option>
                <option value="10">O5</option>
                <option value="11">O6</option>
                <option value="12">O7</option>
                <option value="13">O8</option>
                <option value="14">O9</option>
                <option value="15">O10</option>
                <option value="16">O11</option>
                <option value="17">O12</option>
                <option value="18">O13</option>
                <option value="19">PPI</option>
                <option value="20">O15</option>

            </select>

closed as off-topic by Eric Alexander Sep 13 '16 at 12:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

2

Try this code:

<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>

<script>
var $j = jQuery.noConflict();
$j(document).ready(function() {
    var select = $j("#ctl00_m_g_7bb989f2_7ca9_456f_b0be_ee0996c38db1_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup")
    select.on("change", function() {
        if (select.find("option:selected").val() == "19") {
            window.location = "http://MYOTHERSITEs/NewForm.aspx"
        }
    })
})
</script>

<select name="ctl00$m$g_7bb989f2_7ca9_456f_b0be_ee0996c38db1$ctl00$ctl05$ctl03$ctl00$ctl00$ctl04$ctl00$Lookup" id="ctl00_m_g_7bb989f2_7ca9_456f_b0be_ee0996c38db1_ctl00_ctl05_ctl03_ctl00_ctl00_ctl04_ctl00_Lookup" title="Category">
    <option selected="selected" value="0">(None)</option>
    <option value="6">O1</option>
    <option value="7">O2</option>
    <option value="8">O3</option>
    <option value="9">O4</option>
    <option value="10">O5</option>
    <option value="11">O6</option>
    <option value="12">O7</option>
    <option value="13">O8</option>
    <option value="14">O9</option>
    <option value="15">O10</option>
    <option value="16">O11</option>
    <option value="17">O12</option>
    <option value="18">O13</option>
    <option value="19">PPI</option>
    <option value="20">O15</option>
</select>
  • Unfortunately not, I get nothing. – Glitch_Doctor Sep 13 '16 at 8:50
  • Any error messages in the console? Do you have Minimal Download Strategy activated? – Daniel Stölzner Sep 13 '16 at 8:59
  • Hi I haven't turned on any features at all... I was getting confused by different tutorials for JQuery on SP. I only started using SP last week so not familiar with it's console unfortunately. Took me the week to get my head around workflows and general functionality; I'm a database guy really, apart from the occasional web scrape with VBA this SP web stuff is alien to me. – Glitch_Doctor Sep 13 '16 at 9:07
  • Okay, I'm using Sharepoint 2010, Google tells me Minimal Download Strategy is 2013... – Glitch_Doctor Sep 13 '16 at 9:28
  • The console I'm talking about is the console of your browser. When you hit F12 there should be a tab called Console at the bottom of your screen. JavaScript errors are shown there. Please check if there are any errors. – Daniel Stölzner Sep 13 '16 at 9:56

Not the answer you're looking for? Browse other questions tagged or ask your own question.