2011-12-15 2 views
0

JQuery UI 대화 상자에서 내 페이지를 어떻게 업데이트합니까? 이것은 지금까지 내 코드이며 작동하지 않습니다. 어떤 도움이라도 대단히 감사 할 것입니다.JQuery Ui 대화 상자에서 페이지의 Div를 업데이트하는 방법은 무엇입니까?

function submit_new_site() { 

    //these are the input text id's on the dialog 
    address = $('#loc_address').val(); 
    city = $('#loc_city').val(); 
    county = $('#loc_county').val(); 
    state = $('#loc_state').val(); 
    zip = $('#loc_zip').val(); 
    notes = $('#loc_notes').val(); 

    //and these are the div's on the page that calls the jQuery UI dialog 
    $('#new_site').html(address); 
    $('#new_site_city').html(city); 
    $('#new_site_county').html(county); 
    $('#new_site_state').html(state); 
    $('#new_site_zip').html(zip); 

    //this function is called from a button on the jQuery UI dialog 
    //but is not updating the page with the user entered information.  

} 
+3

기타 코드하시기 바랍니다. 이 행은 어디에서 실행됩니까? –

+0

jsFiddle에서 코드를 보면 도움이 될 것입니다. 무슨 일 이니? –

+0

그게 잘 작동해야합니다 - 그 id가 정말로 유일하다고 가정하면 –

답변

0

$('#loc_address').prop('value')을 대신 시도하십시오. val()은 더 이상 항상 현재 값 인 IIRC를보고하지 않습니다.

+0

감사합니다. mathletics하지만 내 부분에서 정말 어리석은 실수였습니다. 페이지의 ID 이름을 잊어 버렸습니다 ... 감사합니다. –

관련 문제