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 8995117
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:34:36+00:00 2026-06-15T23:34:36+00:00

I create a simple dialog form with jquery UI. Html code : <div id=newarticle-form

  • 0

I create a simple dialog form with jquery UI.

Html code :

<div id="newarticle-form" title="Cr&eacute;ation nouvel article">
    <p class="validateTips">Tous les champs sont requis.</p>

    <form>
    <fieldset>
        <p><label for="validite" class="label-class">Date de validit&eacute;</label>
        <input type="text" name="validite" id="validite" size="10" maxlength="10" class="text input-class" /></p>
        <label for="libelle" class="label-class">Libell&eacute;</label>
        <input type="text" name="libelle" id="libelle" size="50" maxlength="100" class="text input-class" />
        <label for="email" class="label-class">Description</label>
        <input type="text" name="description" id="description" value="" size="50" maxlength="250" class="text input-class" />
        <label for="pu" class="label-class">Prix unitaire</label>
        <input type="text" name="pu" id="pu" value="" size="10" maxlength="10" class="text input-class" />
    </fieldset>
    </form>
</div>

And the javascript/jquery code :

$(function() {  
    $( "#newarticle-form" ).dialog({
        autoOpen: false,
        height: 400,
        width: 800,
        modal: true,
        resizable:false,
        buttons: {
            "Ajouter l'article": function() {
                var bValid = true;
                allFields.removeClass( "ui-state-error" );
            },

            "Fermer": function() {
                $( this ).dialog( "close" );
            }
        },

        close: function() {
            allFields.val( "" ).removeClass( "ui-state-error" );
        },
    });

    $( "#New" )
        .click(function() {
            $( "#newarticle-form" ).dialog( "open" );
    });

});

Some usefull CSS :

.label-class {
    display: block;
    width: 150px;
    float: left;
    text-align: right;
    padding-right: 10px;
}

.input-class {
    float: left;
    margin-bottom: 10px;
}

All works fine… but the fields are completely disorganized.

To align correctly, I must give a total size to each field the almost equal size of the width of the dialogbox ! So, a 5 chars long field must be stretched to the largest field (50 chars) : all is well aligned but it looks quite ugly !

What can I do ?

  • 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-15T23:34:37+00:00Added an answer on June 15, 2026 at 11:34 pm

    Add clear:left; to your .label-class

    This will make sure that the label will align properly.

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

Sidebar

Related Questions

I've been working on a simple JQuery dialog form that loads in via AJAX.
How to create simple PHP COMET server page displaying current time? I need code
Scenario: Using jquery form plugin . The form appears in a dialog, created with
At http://jqueryui.com/demos/dialog/#modal-form , there is a sample modal dialog; when you click on Create
Using Glade to quickly code up a simple GUI, and I'm trying to create
I am trying to run the code from the following link http://jqueryui.com/demos/dialog/#modal-form Why doesn't
I am trying to create a simple dialog box to allow my user to
I Use jQuery Dialog to display a details form when creating a new user.
I have this simple JSF button: //Question Dialog function deletedialog(button, a){ $(<div />, {
What I want to do is quite simple : to display a dialog form

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.