tags:

views:

78

answers:

4

I am using a popup window and I am having a form on that and after submitting the form I am not able to get the confirmation on the same popup window.

Instead it redirects to the original page.

http://careertel.in/index.php In the above site,

there is one for on the home page itself at the bottom of the page "Candidates Register Here"

It is working fine with the format submit etc.,

But if you click the "Job Seekers Upload Your CV here" on the top right of the page, it will open up a pop up with the same form. there the submit is not working.

here only the first there fields are mandatory, the file upload is not mandatory one.

any help

thanks
deve

A: 

in your form tag, set target="_self"

Adam
A: 

How are you handling the submit? If it is just plain old submit button, then it navigates out of the current page (and the state of the popup resets). You should catch the form's submit event and do the submit with ajax instead

$("#form").submit(function() {
  $.ajax({
    type: "POST",
    url: "submiturl",
    data: $("input#name").val(),
    success: function(html) {
      // show the confirmation inside the popup
    }
  })
})

Check more about submitting stuff with AJAX from http://api.jquery.com/category/ajax/. And by googling you might find jquery plugin that converts form to ajax-submittable form.

Juho Rutila
i edited by original post, please check and help me, thanks a lot.
deve
A: 

Well it is not possible to execute javascript in popup. Thats why it redirects to main page after submit.

There are two ways, you can achieve your result,

1) Using window.opener
Call javascript validation function defined in your main page.
eg: function validate defined in main page
so you can call in your popup as,
<form onsubmit="return window.opener.validate()">

2) You can include iframe in popup where you can execute javascript directly.

Hope this helps

Yogesh
A: 
function modalFormSubmit(){
 modalResumeValidation();
 if($('.error').css('display')=="none"){
  modalFileUpload();
 }
 return false;
 } 

I think your problem is somewhere in here. You should check something else than visibility of an element to determine whether you submit (through ajax) the form or not.

Juho Rutila