Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 09:57
    Kaj
    1

    Get the kontent from Dropdown list?

    Im working in Doc2Form. In the form I have dropdown so my customers can select from and then I whant to pressentage the selected text on a webbsite, but I just get the value who is just a number.

    How do I get my cusomers selected text from my dropdonlist??

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 10:41
    Ismail Mayat
    0

    In the source code you will need to tap into that field and use getprevalue method take a look at my hacked version http://www.box.net/shared/mdddu1cu5g i do get prevalue you could use that source code or use my version that said mine is quite different from the original.

    Regards

    Ismail

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 10:51
    Kaj
    0

    Is that really the only choise I have??

    Can´t I then just du I small changes in Doc2Form source code? If so, how then? Is it difficult?? I really have to solve this.

    Cuz if I install your packe I have to do everything from beginning.

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 14:55
    Kaj
    0

    Ismail if I use your package, can I install it and over-right my Doc2Form I allready have installed, and use it with everyting I allready build upp??

    Best regards,

    Kaj

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 15:10
    Ismail Mayat
    0

    Worth a try however make sure you take a back up of everything so you can roll back.

    Regards

    Ismail

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 15:43
    Kaj
    0

    It seems to work :))

    So how do I do I do now to get the text in the dropdown?

  • Ismail Mayat 4511 posts 10092 karma points MVP 2x admin c-trib
    Dec 20, 2010 @ 15:54
    Ismail Mayat
    0

    mis understood your question in my code the email which can be sent out resolves drop down values from ids to values, if you want to show value on a page you need to use the umbraco.library.GetPreValue method this can also be used in xslt 

    Regards

    Ismail

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 16:15
    Kaj
    0

    I try this:

    <xsl:value-of select="umbraco.library:GetPreValues('1486')"/>

    But then I get all PreValues in hole DropDown? I just whant to get out current PreValues in dropdown when it publich it?

     

    Regards,

    Kaj

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 19:13
    Kaj
    0

    I have google a lot now!!

    Is it really no way to get current PreValue from a dropdownlist in backend to display in frontend??

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 20, 2010 @ 19:34
    Tom Fulton
    0

    Hi,

    Not sure your setup exactly with Doc2Form, but if you can use GetPreValues, and you can get the ID of the one selected, you should be able to translate it using something like this

    <xsl:value-of select="umbraco.library:GetPreValues('1486')/preValue [@id=$mySelectedValue]/."/>

    Where $mySelectedValue variable contains the currently selected prevalue ID

    -Tom

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 19:46
    Kaj
    0

    Ok thanks Tom!

    But I need to know and get out currently selected prevalue without knowing what the customurs choosed in the dropdown?

    I need simple to get the selected value in dropdown?!

    Regards,

    Kaj

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Dec 20, 2010 @ 19:56
    Tom Fulton
    0

    Why don't you know what the customer selected from the dropdown?  Isn't this happening after they submit/publish?  I was thinking you were able to get the number (prevalue ID) according to your first post.

     

  • Kaj 41 posts 73 karma points
    Dec 20, 2010 @ 20:03
    Kaj
    0

    I don´t know cuz it going to publich on the webbsite direktly after submiting.

  • Kaj 41 posts 73 karma points
    Dec 21, 2010 @ 14:49
    Kaj
    1

    I solved it in the end.

    Here is the solution if anyone else would face the same problem:

                    <xsl:variable name="myID">
                      <xsl:value-of select="myDropDown"/>
                    </xsl:variable>
                    
                   
                    <xsl:choose>
                      <xsl:when test="$myID = '19' ">
                         myProduct1
                      </xsl:when>
                      <xsl:when test="$myID = '20' ">
                         myProduct2
                      </xsl:when>
                      <xsl:when test="$myID = '21' ">
                        myProduct3
                      </xsl:when>
                      <xsl:otherwise>
                      Anything
                      </xsl:otherwise>
                    </xsl:choose>

     

    Best regards,

    Kaj

Please Sign in or register to post replies

Write your reply to:

Draft