How do I reset a slider value after it has been declared from a
calling page?

I have a modal box, that has a form in it.  I use this form to add/
edit items.  Within that form, I have a slider from jquery UI.  When I
click on a link to bring up the modal box and EDIT data, I'm having
trouble populating the slider with the appropriate value.  Anyone know
how?  THANKS IN ADVANCE!

Here is the relevant code from my files:

MAIN PAGE:

        <script type="text/javascript">
        <!--
        $(document).ready(function() {
            $('#addItem, .editItem').click(function(e) {
                        e.preventDefault();
                        // load the contact form using ajax
                        $.get("modalForm.cfm", {'action' : 
$(this).attr("name")}, function
(data){
                                // create a modal dialog with the data
                                var d = $("<div></div>").append(data);
                                $(d).modal({
                                        overlay:80,
                                        overlayCss: {backgroundColor:"#c0c0c0"},
                                        escClose: true,
                                        overlayClose: true,
//                                      position: [e.pageY,e.pageX],
                                        onOpen: function(modal) {
                                                modal.overlay.fadeIn(5, 
function() {
                                                        modal.data.hide();
                                                        
modal.container.fadeIn(5, function() {
                                                                
modal.data.slideDown('fast');
                                                        });
                                                });
                                        }
                                });

                                $("#slider").slider({
                                        value:80,
                                        min: 20,
                                        max: 100,
                                        step: 20,
                                        animate: true,
                                        orientation: 'horizontal',
                                        slide: function(event, ui) {
                                                
$("#slideramount").val(ui.value);
                                        }
                                });

                        });
                });
        });
        // -->
        </script>


MODAL FORM PAGE:


<div id="slider" style="width:150px;font-size: 9px;font-family:
Arial;"></div>


Reply via email to