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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T17:46:51+00:00 2026-06-17T17:46:51+00:00

I have an application here: HERE In application please do the following: In the

  • 0

I have an application here: HERE

In application please do the following:

  1. In the text area at top type in some content
  2. Click on Add Question button to append content into table below. You can see the content in the textarea in the table is placed at the top of the textarea.
  3. Now you will see a file input, please upload an image using the file input.
  4. Now when the upload finishes, it appends the name of the file, a hidden input and a remove button underneath, but look at the textarea with your content in ther other column, the text has moved down a space. It has not stayed on top.

That is my question, how in this situation am I able to keep the text in the text input remain at the top of the textarea?

Below is the main code:

The textarea and file input appended into the table row:

var count = 0;
var gQuestionIndex = 0;

function insertQuestion(form) {   

      var questionarea=(form.questionText.length)
                ? form.questionText[0]
                : form.questionText;


    var $tbody = $('#qandatbl_onthefly > tbody');
    var $tr = $("<tr class='optionAndAnswer' align='center'>");
    var $question = $("<td width='13%' class='question'></td>");
    var $image = $("<td width='17%' class='image'></td>");
    var $questionType = '';

    gQuestionIndex++;


    $('.questionTextArea').each( function() {

    var $this = $(this);
    var $questionText = $("<textarea class='textAreaQuestion'></textarea>").attr('name',$this.attr('name')+"[]")
                   .attr('value',$this.val());

    $question.append($questionText);

    });



    var $fileImage = $("<form action='imageupload.php' method='post' enctype='multipart/form-data' target='upload_target_image' onsubmit='return imageClickHandler(this);' class='imageuploadform' >" + 
    "<p class='imagemsg'></p></label>" +
    "Image File: <input name='fileImage' type='file' class='fileImage' /></label><br/><br/><label class='imagelbl'>" + 
    "<input type='submit' name='submitImageBtn' class='sbtnimage' value='Upload' /></label>" + 
    "<p class='listImage'></p>" +
    "<iframe class='upload_target_image' name='upload_target_image' src='/' style='width:0px;height:0px;border:0px;solid;#fff;'></iframe></form>");     

    $image.append($fileImage);


    $tr.append($question);
    $tr.append($image);
    $tbody.append($tr); 

    count++;

    $(form).find('.numberOfQuestions').val(qnum);

    form.questionText.value = "";

    $('.questionTextArea').val('');


    setWidth();

}

The setWidth() code where it ensures the textarea remains filling the table cell if the table cell has it’s height and width changed:

function setWidth() {
    $(".textAreaQuestion").each(function(){
     var questionCellWidth = $(this).closest(".question").width();
    var questionCellHeight = $(this).closest(".question").height();
    $(this).css({
        "width": (questionCellWidth - 6) + "px",
        "height": (questionCellHeight) + "px"
    });

    });
  }

The stop uploading function where it appends the filename, remove button and hidden input:

function stopImageUpload(success, imageID, imagefilename){

      var result = '';
      imagecounter++;

      if (success == 1){
         result = '<span class="imagemsg'+imagecounter+'">The file was uploaded successfully</span>';   
            $('.listImage').eq(window.lastUploadImageIndex).append('<input type="hidden" name="imgid[]" id="'+imageID+'" value="' + imageID + '" />');
            $('.listImage').eq(window.lastUploadImageIndex).append('<div>' + htmlEncode(imagefilename) + '<button type="button" class="deletefileimage" data-imageID="'+imageID+'"  data-image_file_name="' + imagefilename + '">Remove</button><br/><hr/></div>');
         }


      $(sourceImageForm).find('.imagemsg').html(result);
      $(sourceImageForm).find('.imagemsg').css('visibility','visible'); 
      $(sourceImageForm).find(".fileImage").replaceWith("<input type='file' class='fileImage' name='fileImage' />");
      $(sourceImageForm).find('.imagef1_upload_form').css('visibility','visible');


      return true;   
}

Finally below is the css for the textarea:

.textAreaQuestion{
    width:100%;
    resize:none;
    height:100%;
    border:0;
    padding:0;
    font-size:100%;
    display: block; 
    overflow:auto;
    margin:0;
    vertical-align:top;
}
  • 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-17T17:46:52+00:00Added an answer on June 17, 2026 at 5:46 pm

    Try adding to your CSS:

    td.question {
        vertical-align:top;
    }
    

    The problem is that your right-hand column is creating more vertical space, and your cells are set to their normal state, which starts text vertically-aligned in the center of the cell.

    Better, even, would be something like this:

    td {
        vertical-align:top;
        padding: 1em .5em; /* or something to this effect, 
                              to normalize the spacing of 
                              data from the cell-sides */
    }
    

    This way, no matter how much information is added to the right-most column cell, all the cells will start aligned to their tops at about the same place. You might have to also adjust some margin spacing around the textarea, if you want to really align the text, but this should at least get you started.

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

Sidebar

Related Questions

I have a Jsfiddle application here . If you type in a question in
I have an application here: Application In the application please do the following: You
here is a good question: I have an application compiled for iPhone OS 2.21.
I have the following html, i tried many many regex to remove hperlink content/text
Here is the scenerio: We have an application running on Webphere Portal Server 6.1
So here is the problem that I am facing: I have an application that
i have developed application for read information from card reader. Here i have used
I have an application I need to analyze. I have the source code here.
Kinda stuck here... I have an application with lets say 5000 rows of data
This is to create a greeting card application and here i have to change

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.