is working with codeigniter and trying to submit a form and then closing it with javascript Am I |
I have a popup function;? I call from the parent page:
& lt; A href = "javascript: popups ('admin / method / variable', 'click', '400', '400')" & gt; Click & lt; / A & gt; And here's the function:
function declines_popup (url, name, width, height) {var top = parseInt ((screen.availHyight / 2) - (height / 2)); Var left = parseInt ((screen.availWidth / 2) - (width / 2)); Var attribute = "location = 1, position = 1, scrollbar = 1, width =" + width + ", height =" + height + ", top =" + up + ", left =" + left; Window.open (url, name, features);} and it opens the form:
& lt; Php echo form_open ('state / validate_rejection/'.file_results->sender_id.'/'.$this->+session->userdata('id'). '/' .file_results- & gt; id, array ( 'Name' = & gt; 'Rejection_form', 'id' = & gt; 'Disapproval_form', 'onsubmit' = & gt; 'window.forms [0]. Submit (); self.close ();') ); ? & Gt;
& lt; P & gt; & Lt; Label & gt; Write the reason for the disapproval? & Lt; Span class = 'req' & gt; * Required & lt; / Label & gt; & Lt; Textarea name = "remarks" rows = "8" maximum-width: 380px "autofocus required>
< / P>
& lt; input type = "button" square = "button" value = "cancel" /> gt; & lt; input name = "submit_rejection" id = "Submit_rejection" type = "submit" class = "button" value = "send" /> gt;
As you can see that the form Action is a URL that goes to the controller / method: Here is the method I use: validate the function _rejection () {$ this-> form_validation- & gt; set_rules ('tip ($ The -> form_validation-> run () == true) {$ sender_ id = $ this-> uri-> Segment); if $ ($ - - 'Remarks', 'Remix', 'Trim | Required'); (3)? $ This-> uri-> Segment (3): 0; $ user_id = $ this-> uri-> Segment (4)? $ This-> uri- & Gt; Segment (4): 0; $ file_id = $ this-> Yuri-> Segment (5)? $ This -> Yuri-> Segment (5): 0; // Here the codeigniter model is called a function, and if the query is passed then it goes wrong, if it is $ rejection = $ this-> Files_model- & gt; Reject E ($ sender_id, $ user_id, $ file_id); If ($ rejection == true) {$ this-> Session-> Set_flashdata ('disapproval_succ', 'successfully rejected'); // redirect ('home'); } Other {$ this- & gt; Session-> Set_flashdata ('disavow_file', 'file declery failure'); }} And {$ this-> Session-> Set_flashdata ('remark__validation_errors', validation_errors ()); }} ND If the form was successfully submitted or unsuccessful, it would set a flash data
Now I want the form to be finalized Or does not the parent's father near Rolod and Popup ?? | Can anybody please help me get this ?? This is a javascript case, but as long as I'm working with coding, thought it would be the best place to post this thread?
Note: For the poor formatting ... im new user and I do not find the code block: S
If I were to you I would use the jQuery dialog. - If hot water is changing then it already exists. The only thing you need to add is to refresh the page.
No comments:
Post a Comment