Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9123035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T06:14:34+00:00 2026-06-17T06:14:34+00:00

I have one little problem with my web. I have there form in external

  • 0

I have one little problem with my web. I have there form in external file, something like below.

<form action="/action.php" method="post" id="formularz_dodaj" target="iframe_id">
    <fieldset>
        <input type="hidden" name="ac" value="groups_save" />
        <ul>
            <li>
                Some fields here
            </li>
            <li class="buttons">
                <input type="submit" class="zapisz" value="Zapisz" />
                <input type="button" class="anuluj" value="Anuluj" />
            </li>
        </ul>
    </fieldset>
</form>
<script type="text/javascript">
    //<![CDATA[
    $j('.zapisz').button().click(function(){
        $j('.anuluj').hide();
    });
    $j('.anuluj').button().click(function(){
        $j('#dialog').dialog('close');
    });
    //]]>
</script>

As You can see, there is nothing special about it except buttons. As a result form gets styled buttons via jQuery. Button <input type="submit" class="zapisz" value="Zapisz" /> should work as normal submit, <input type="button" class="anuluj" value="Anuluj" /> should just clos the dialog.
This form is placed in dialog via jQuery ajax() method like so:

var $j = jQuery.noConflict();
var main = new Object();

$j.extend($j.ui.dialog.prototype.options, {
modal: true,
resizable: false,
width:'auto',
height:'auto',
show:{
    effect:'fade',
    duration:'fast'
},
hide:{
    effect:'fade',
    duration:'fast'
},
open:function(){
    $j(this).find("input[type=text], input[type=password], input[type=checkbox],     select, textarea").uniform();
}
});
main.dialog = function(ob){
if(ob.url){
    var url = arguments.url;
    var dialog = $j("#dialog");
    if ($j("#dialog").length == 0) {
        dialog = $j('<div id="dialog" class="dialog" title=""></div>').appendTo('body');
    }
    if(ob.title){
        dialog.attr('title', ob.title);
    }
    $j.ajax({
        type:'POST',
        dataType:'html',
        data:ob.dane,
        url:ob.url,
        success:function(d){
            if(d == 'uprawnienia'){
                main.alert({
                    text:'Nie posiadasz uprawnie\u0144 do tej operacji.', 
                    title:'Brak uprawnie\u0144'
                });
            } else {
                $j("#dialog").html(d);
                $j("#dialog").dialog({
                    title:$j("#dialog").attr('title')
                });
            }
        },
        error:function(){
            alert('Niepoprawne rz\u0105danie.');
        }
    });
} else {
   alert('Brak pliku do za\u0142adowania.');
}
}

The target for data is an iframe placed in main index file.

<iframe name="iframe_id" id="iframe_id" src="" style="display:none; width:400px; height:200px;"></iframe>

What happens is when i use button with class “.zapisz” nothing happens in specific browsers: IE8, Chrome, Safari. In IE9 and FireFox it’s working as it should.

I’ve checked the console in any of my browsers and there is no error. No data from form is sended to iframe. Only JS added in click method is executed.

Button “.zapisz” works as they should only when document.getElemntById('formularz_dodaj').submit(); is written in click function.

Anyone have idea what can be wrong?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T06:14:35+00:00Added an answer on June 17, 2026 at 6:14 am

    Because there was no solution or pointed cause of such behavior I founded some workaround solution. Because all dialog (in my case) contain buttons witch classes .zapisz and/or .anuluj and usage of them is identical in each case i predefined such code:

    $j.extend($j.ui.dialog.prototype.options, {
        modal: true,
        resizable: false,
        width:'auto',
        height:'auto',
        show:{
            effect:'fade',
            duration:'fast'
        },
        hide:{
            effect:'fade',
            duration:'fast'
        },
        open:function(){
            $j(this).find("input[type=text], input[type=password], input[type=checkbox], select, textarea").uniform();
            $j(this).find('input[type=submit], input[type=button]').button();
            $j(this).find('.zapisz').each(function(){
                $j(this).click(function(){
                    $j(this).parents('form').submit();
                    $j(this).parents('form').find('.ui-state-error').hide();
                });
            });
            $j(this).find('.anuluj').each(function(){
                $j(this).click(function(){
                    $j(this).parents('.dialog').dialog('close');
                });
            });
            $j('.ui-icon.ui-icon-closethick').on('click', function(){
                $j(this).parent().parent().hide();
            });
            $j(this).find('.ui-state-error').hide();
            $j('span.opis').tooltip();
        }
    });
    

    What this code does is (omitting basic settings like effects etc.) when dialog is opened it searches for buttons with thosw classes .zapisz and/or .anuluj and gives them a proper action according to parent. So now there is no need to add submit() to every form i have manualy.

    Next thing is when i need to add some other actions to any of those button i simply write them in form itself just like that:

    $j('.zapisz').click(function(){
        $j('.anuluj').hide();
        $j(this).val('Wysy\u0142am dane');
        $j(this).attr('disabled', 'disabled');
    });
    

    Notice that there is no longer button() method before adding click().

    Now i have dialogs that are formated as i wanted and works as expected by default.

    Still i have no idea why my issue happens in some browsers, so if You will have any information about that it would be nice for the future.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have developed several GWT Web Applications. Latest one is a little modification of
I'm currently developing a web application and have run into a little problem. I'm
I have a little problem and because my WEB development skills are not the
I have a little one-liner in my Rails app that returns a range of
I have a site I'm trying to build and I've hit one little snag
This one is a little tricky. Say I have this XmlDocument <Object> <Property1>1</Property1> <Property2>2</Property2>
Case One Say you have a little class: class Point3D { private: float x,y,z;
I have this little script that shows one wisdom each day. so I have
For some time i have been making more or less little games. One level
I am experiencing a little pain on Android. I have two activities, one is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.