How to get this function via jquery?

Discussion in 'jQuery' started by nshadab, Jan 11, 2011.

  1. #1
    I have one form:

    CityManagement.php

    I need one popup to come-up for EDIT
    When i say SUBMIT, it must refresh the list box(contains cities) contents and should not reload the page....

    is there any good script to do so?
     
    nshadab, Jan 11, 2011 IP
  2. Fresh Jr13

    Fresh Jr13 Peon

    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    hi my name De Janeiro
     
    Fresh Jr13, Jan 11, 2011 IP
  3. kokulusilgi

    kokulusilgi Peon

    Messages:
    16
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    you can use jquery for this.

    when you clicked the edit link, open modal edit box. and when you click the save button, your codes save the data with ajax. if save progress is success you add the this code in ajax success function

    for example.
    
    $.post('/cityupdate/'+cityid, 
    				function(data){
    					if (data=='success')
    					{
    						$('#yourSelectboxId option[value='+cityid+']').text($('#yourInputTextId').val());
    					} else {
    // alert ajax return error messages
    						alert(data);	
    					}
    				});
    
    HTML:
     
    kokulusilgi, Jan 14, 2011 IP