Dynamic textbox movement

I have a textbox in a JSP file that appears only when a particular value is selected in a listbox. This has been done through Javascript.
Now, when the textbox is added, the whole form moves down.
How to eliminate this movement?
Following's the Javascript code:
function textBox(areaName, submitted)
var spanTxtID = document.getElementById('insertTxtSpan');
var txtSpan = document.getElementById('txtSpan');
var areaNameText=document.createElement('input');
areaNameText.setAttribute('type', 'text');
areaNameText.setAttribute('name', 'areaNameText');
areaNameText.setAttribute('maxLength', 20);
areaNameText.setAttribute('size', '30');
areaNameText.setAttribute('height', '21.3');
if(areaName.value=="Other")
submitted=false;
while(errSpan.hasChildNodes()) errSpan.removeChild(errSpan.lastChild);
while(txtSpan.hasChildNodes()) txtSpan.removeChild(txtSpan.lastChild);
while(spanTxtID.hasChildNodes()) spanTxtID.removeChild(spanTxtID.lastChild);
spanTxtID.appendChild(areaNameText);
else
submitted=false;
while(errSpan.hasChildNodes()) errSpan.removeChild(errSpan.lastChild);
while(txtSpan.hasChildNodes()) txtSpan.removeChild(txtSpan.lastChild);
while(spanTxtID.hasChildNodes()) spanTxtID.removeChild(spanTxtID.lastChild);
}

Helo Ananth,
What i want is as i press one button i want one textbox object shuld appear on the canvas.I am not talking about the thing like we make one textbox and on click of button it must be visible.so i want to make a textbox dynamically or at runtime it shuld appear.
TQ
Vivek

Similar Messages

  • Creating dynamic textbox in JSP

    I am trying to create dynamic textbox.when i run this below JS ,I am getting two boxes only and then i nothing getting it displayed.The problem comes in the inner for loop.
    function DynamicBox(val)
                        alert("helloooo");
                         var d =document.getElementById("bottom");
                         d.innerHTML = '<table cellpadding="10">';
                        for(i=0;i<val;i++)
                                d.innerHTML += '<tr><td><INPUT type="text" name="week'+i+'" size=8 >  </td><td><INPUT type="text" name="deliverable'+i+'" size=30>  </td>';
                              for(j=1;j<=<%=parameter.length%>;j++)
                                       <% int m=0;%>
                                      d.innerHTML+='<td><INPUT type="text" name="'+<%=parameter[m]%>+i+'" size=10></td>';
                                      <% m++; %>
                                 d.innerHTML +='</tr><br />';
                            d.innerHTML+='</table>';
                    }In the above code,val is the number of rows to be created.Bottom is the id of the <div> tag.parametr is a String array.The values are coming from database.

    move the <% int m=0;%> out of the loop.. You have place it in the loop, causing it to be initialize to be 0 each time the looping occurs.
    Place <% int m=0;%> below the line: d.innerHTML = '<table cellpadding="10">'

  • Grab Frame Number, add 6 and display in dynamic textbox

    Hey,
    I have a gallery that needs numbered images. To do this I
    need to grab the current frame number of a parent movie, add 6 and
    display in a dynamic textbox. Sounds simple!
    The frame number I need to grab is in:
    _root.gallery
    The dynamic textbox has the var name 'displayNumber' and is
    in:
    _root.gallery.controlbox
    I need this to refresh every time the frame number changes in
    the _root.gallery clip. This is a fairly urgent project so swift
    help is obviously appreciated!
    Thank you in advance

    your code will work if all you state is valid and there's no
    other _root.gallery.onEnterFrame overwriting the one you
    posted.

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • Passing Input Text Data to Dynamic TextBox in Another Scene

    Hi everyone there,
    I am creating a quiz for my school using flash.
    I am wondering if it is possible to pass the answers key in
    by students in the input text field to the dynamic textbox at the
    end of the entire quiz to show all the ans by the students and all
    the model ans of the quiz.
    May i know if this can be done?
    Or is it better to pass info from text box to text box in
    from one frame to another in the same scene?
    Also, how do i create a page that will list down the total
    number of questions the student has answered correctly and show her
    score?
    Thank you very much.
    FiOh
    *^^*

    An instructor at a summer camp told me to avoid scenes, so
    I've been afraid of them ever since.
    I'm not sure I quite understand the first post - you want the
    students to put in their own answer key?
    I made a quiz once. It was about genetics. This first frame
    had a "let's go" button that started the quiz. Each consecutive
    frame had a question and an oddball amount of input fields. The
    frame had each input set to a certain variable. At the end it added
    one to the score variable for each textfield that matched my magic
    answer. You could do all kinds of things this way. The syntax
    looked something like:
    if(input3A.text = whatever the answer is) {
    ++score; //adds to score variable
    and it could make a result3A_txt.text = "Bingo";
    "input3A" is arbitrary - for problem three, two, etc. the
    text field was called "input" and then a number, and then, if there
    was more than one text field for that problem, a letter. This is
    just the first field in problem three.
    The second line in the if statement talks to a field. You put
    a static text with the problem number, and next to it,
    result3A_txt. If the user answered the problem correctly, the field
    will become "Bingo" or something. You would do this for each
    problem so that every correct one would say "Bingo."
    To get a percent score:
    percent_txt.text = Math.round((score / max_score) *
    100);

  • Reusing dynamically loaded movies

    Hello,
    I am trying to reuse a dynamically loaded movie which has
    been loaded with a movie clip loader. The movie loads fine and can
    be displayed once with no problem. However, I would like to be able
    to store this movie so that it can be resused again without loading
    it from the URL again. Is there a way to do this?
    I found this in the docs:
    quote:
    the problem w/ attachmovie is that one must have a link
    identifier (in linkage panel) in order to attach it.
    there is no way (that i know of) to attach a *dynamically*
    created clip - either by duplicateMovieClip or
    createEmptyMovieClip.
    I'm hoping this isn't true. What if I had a JPG I loaded
    dynamically and I wanted to use it 100 times? I can't imagine
    having to load the JPG 100 times.
    I need something like attachMovie(), but that only works with
    movies that are already in the library. Does anyone know if there a
    way to reuse a dynamically loaded movie? I've tried all sort of
    combinations of createEmptyMovieClip, duplicateMovieClip, and
    attachMovie but nothing has worked.
    FYI - I am using Flash 2004 MX Pro and ActionScript 2.0.

    yes, load it 100 times. it will be retrieved from the user's
    browser cache after the first time so this is not the limitation
    you're thinking it might be.

  • Dynamic textbox through the Back button

    I have created a dynamic textbox in a JSP using Javascript.
    When I submit the form in this JSP, the data's validated & a confirmation message is displayed.
    On this confirmation message, when the Back button is clicked, I get the original form with the data entered for all the fields except for the dynamic textbox, because there is no dynamic textbox!
    The textbox is to be displayed only when a condn is fulfilled. This is coded in a Javascript fn that gets called only when a particular value in the listbox of the form is selected.
    How do I display the textbox when the Back button's clicked?

    Thx for trying to help.
    Here's the source code:
    <script language="JavaScript">
    <!--
    function textBox(areaName, submitted)
    var spanTxtID = document.getElementById('insertTxtSpan');
    var areaNameText=document.createElement('input');
    areaNameText.setAttribute('type', 'text');
    areaNameText.setAttribute('name', 'areaNameText');
    areaNameText.setAttribute('maxLength', 20);
    areaNameText.setAttribute('size', '20');
    //areaNameText.setAttribute('value', 'Khar');
    //alert(areaName.value)
    if(areaName.value=="Other")
    submitted=false;
    while(spanTxtID.hasChildNodes()) spanTxtID.removeChild(spanTxtID.lastChild);
    spanTxtID.appendChild(areaNameText);
    else { submitted=false; while(spanTxtID.hasChildNodes()) spanTxtID.removeChild(spanTxtID.lastChild); }
    -->
    </script>

  • How to create dynamic Textbox in JSP

    I created dynamic Textboxes using javascript in JSP.But i want to give every textbox a unique name..But I dont know how to give unique name to all the textbox which are created dynamically.....Can u help me Please.............
    <script code="text/javascript">
    function dynam(val)
    var d= document.getElementById("Bottom");
    d.innerHTML='<table>';
    for(i=1;i<=val;i++)
    d.innerHTML += '<tr><td>Parameter</td><td><INPUT type="text" name="week"'+i+'size = 15></td>';
    d.innerHTML +='</table>' ;
    </script>in the above code."val" is the integer value passed while calling this function. "Bottom" is the id of <DIV> tag in my JSP page.
    My problem is : when i creating a text box. the Unique name of the textbox in not getting generated.All the text bok has the same name as "week",but i want the name to be as week1,week2,week3,.....etc
    Edited by: AnilTcs on Jan 21, 2009 1:31 AM

    Try this:
    d.innerHTML += '<tr><td>Parameter</td><td><INPUT type="text" name="week '+i+' " size = 15></td>';I have just changed the quotes around week. Hope this helps.

  • Remove dynamic textbox on loading an image

    I'm trying to remove a line of text placed in a dynamic textbox inside a MC after an image loads in the imageloader component.
    I've highlighted the line in RED in the code below.
    Maybe a timer for this text to disappear or a statuschange function would be helpful. I've been searching extensively but in vain. Any heads-up please?!
    Any help would be much appreciated.
    Thanks.
    Sudarshan
    // Import the MX.UTILS so it can be used to set the scope of the listBox listener and the xml onload feature
    import mx.utils.Delegate;
    // Define default URL to load if no URL is defined in XML attribute
    _root.urlLink = "http://www.somesite.com";
    // declare variables
    var people:Array;
    var product:Array;
    var update:String;
    var dirpath:String;
    // set up the XML instance
    var peoplexml:XML = new XML();
    // initialize items on stage
    _global.style.setStyle("fontFamily","Verdana");
    _global.style.setStyle("fontSize",11);
    // define what should happen when the XML loads
    // (read data into update, dirpath, and brand variables)
    function onXmlLoaded(success:Boolean)
        if (success)
            // make a handle to the root node in the xml
            var mainnode:XMLNode = peoplexml.firstChild;
            update = mainnode.attributes.lastupdate;
            dirpath = mainnode.attributes.dir;
            // set up an array of all brand nodes
            var peoplenodes:Array = peoplexml.firstChild.childNodes;
            for (var i:Number = 0; i < peoplenodes.length; i++)
                // for each brand node:
                var personnode:XMLNode = peoplenodes[i];
                people.push({i:i + 1, pname:personnode.attributes.name});
            // data is all read and put in the right place -- now setup the screen
            // using this data
            setup();
        else
            trace('error reading XML');
    function setup()
        // set up chooseperson dropdown
        choosebrand.labelField = "pname";
        choosebrand.dataProvider = people;
        choosebrand.addEventListener("change",Delegate.create(this, loadProducts));
    function loadProducts(evt:Array)
        var thisitem:Array = evt.target.selectedItem;
        var productList:Array;
        chooseproduct.labelField = "prname";
        product = [prname];
        var peoplenodes:Array = peoplexml.firstChild.childNodes;
        for (var i:Number = 0; i < peoplenodes.length; i++)
            // for each brand node:
            var personnode:XMLNode = peoplenodes[i];
            if (personnode.attributes.name == thisitem.pname)
                var productnodes:Array = personnode.childNodes;
                for (var j:Number = 0; j < productnodes.length; j++)
                    // for each product node:
                    var productnode:XMLNode = productnodes[j];
                    product.push({i:j + 1, prname:productnode.attributes.title, img:productnode.attributes.photo, url:productnode.attributes.url, txt:productnode.attributes.txt, det:productnode.attributes.det, price:productnode.attributes.price, clck:productnode.attributes.clck});
                loader.img.contentPath = "";
                loader.clck.text = "";
                loader.ldng.text = "";
                productTitle.ptitle.text = "";
                productTitle.pdet.text = "";
                productTitle.prc.text = "";
        //initialize the product array
        chooseproduct.labelField = "prname";
        chooseproduct.dataProvider = product;
        chooseproduct.addEventListener("change",Delegate.create(this, loadImage));
    function loadImage(evt:Array)
        var thisitem:Array = evt.target.selectedItem;
        productTitle.ptitle.text = thisitem.txt;
        productTitle.pdet.text = thisitem.det;
        productTitle.prc.text = 'Rs.'+ thisitem.price;
        loader.img.contentPath = thisitem.img;
        loader.clck.text = thisitem.clck;
        loader.ldng.text = 'Loading Image...';
        _root.urlLink = thisitem.url;
    function init()
        // initialize the brand array
        people = [pname];
        // set up the xml instance to ignore whitespace between tags
        peoplexml.ignoreWhite = true;
        // set the scope of the onLoad function to the main timeline, not peoplexml
        peoplexml.onLoad = Delegate.create(this, onXmlLoaded);
        // start the xml loading
        peoplexml.load("bannerxml.php");
    init();

    You can use the setTimeout() function if you want to delay some code from executing

  • Font related issue in dynamic textBox

    hi everybody,
    i hv a problem. i m loading data from XML file which of UTF-8
    encoded and showing it on a dynamic textBox. i m using the font
    Arial which is already embaded in the library. the problem is that
    the data is not showing n if i chenges the data to that of english
    the data shows up. but if i m creating the dynamic textBox at the
    _root even chinese data also showing properly.
    can any body help me to find out what could be the exact
    problem , thanks
    can u please PM me top [email protected]

    well that depends how u are using your text. an XML can be
    easiliy shown in Dynamic text box. there are some issues when you
    mask it,
    although do one thing, if you are using Arial try not to
    embed and then see what happens, if it still raises a problem, let
    me know

  • Why does ' ' kill my dynamic textbox content?

    Well... I think it's because Flash sees it as a broken HTML tag, so I guess my real question is how to fix it?
    Here's the scoop:
    I have a dynamic textbox which is being assigned a variable. The textbox is set to render as HTML and all fonts are loaded.
    The following variables appear fine in my textbox:
    varText = "This is <b>bold</b>";
    varText ="Two is > One.";
    but this one
    varText ="One is < Two.";
    is truncated as soon as it hits the "<".  Wrapping everything in <p>variable</p> doesn't help
    Any ideas?
    Thanks,
    - JG

    OK... I go it solved.
    First I realized that inserting a &#60; into the HTML string did display the "<".
    But, a mass replace killed all my actual HTML tags of course.
    So, I had to write a script to seek out all instances of "<" and leave the actual tags alone (eg <b>, </b>, etc.), but replace the other instances with the character code.
    There's probably a better way... but at least this works.
    Thanks,
    - Jamal

  • Looping a dynamic textbox to update its content?

    i have a 100 frame movieclip with a dynamic textbox inside that outputs the current frame.
    This movieclip gradualy goes from frame 100 - frame 0.
    would i need this textbox on 100 frames with code on each or just 1 stretched through the 100 frames? i can get it to say 100, when its on the 100th frame but its doesnt go to 99 98 etc.
    atm i tryed:
    mc.onEnterFrame = function()
    mc.text = _currentframe;
    but that doesnt work.

    If mc is a textfield, textfields do not have an onEnterFrame method.  Try using this instead...
    this.onEnterFrame = function()
           mc.text = _currentframe;
    You should only need one instance of the textfield spanning across the timeline.

  • JS validation for dynamic textbox

    How can i validate dynamic textbox using javascript?.
    item_val_#i# is required field.
    <cfloop from="1" to="#count#" index="i">
    <input type="text" name="item_val_#i#" size="5"
    maxlength="5">
    </cfloop>

    use the same cfloop inside your js code (assuming it is IN
    THE SAME
    PAGE, not in a separate file).
    obviously, your #count# variable must be set BEFORE the js
    code...
    something like [not complete function]:
    function validatefields(){
    var errstr = "";
    <cfloop...>
    (document.forms[0].elements["item_val_#i#"].value=="") ?
    errstr =
    errstr + "\nField Myfield#i# must have a value!" : errstr =
    errstr;
    </cfloop>
    but i would suggest you better validate input server-side...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Textboxes move in random directions

    Textboxes move in random directions when I move them with the arrow keys. If I press down and keep it pressing, they sometimes start moving upwards, and then slowly change they "trajectory" towards the expected direction. Other times they ALMOST
    take the right direction at first.

    Hi,
    In which Office application do you experience the issue? Or the issue occurs in all Office applications?
    Please try to launch the specific Office application in safe mode and see if issue persists:
    http://office.microsoft.com/en-us/excel-help/work-with-office-safe-modes-HP010354300.aspx
    If it works well in safe mode, then issue might be caused by some add-ins.
    Also, please install any available Office or Windows updates and then check result.
    Thanks,
    Ethan Hua CHN
    TechNet Community Support

  • Alpha properties in a dynamically generated movie

    the situation:
    i have to dynamically generate a movie clip
    inside the already created movie clip i have two event
    controllers which ( SHOULD) set the _alpha state of two instances(
    which happen to be 2 diff key frames of one animation sequence
    turns out im unable to get anything to happen with either one
    of the instances -- the variables which control the MC are
    accessible to the function b/c a trace(var); statment will trace
    the correct value -- but the movie clip wont set its _alpha to that
    passed value.
    any suggestions???

    that is correct
    the trace statement is directly above the _alpha assignment
    statement
    the newer post i just put up is a little less convoluted --
    so it might make a little more sence

Maybe you are looking for

  • Delete Duplicates from internal table with object references

    Hi How can I delete duplicates from an internal table in ABAP OO based on the value of one of the attributes? I have created a method, with the following code:   LOOP AT me->business_document_lines INTO l_add_line.     CREATE OBJECT ot_line_owner    

  • "The feature you are trying to use is on a network resource not available"

    Recently, every time I try to install the new version of itunes I've been getting this error message. it says to enter an alternate path to a folder containing the installation package "Itunes.msi". I've looked for this package and even found it but

  • Down payment request against PO

    Hi SAP Guru, When user entering down payment request in F-47 against  a purchase oder the system is allowing to post the amount more than PO value which is logically incorrect. How can I prevent this ? Kindly reply with details. Regards, Sajib

  • What are the advantages and disadvantages to cookies?

    Ok, so I am required to interview some expert for a Final in college. I choose to do my final on cookies throughout the different browsers. The downside is that it is nearly impossible to get a one-on-one interview from an expert in this field. This

  • My music is no longer "found" after home sharing

    I recently got a Macbook Pro 15" Retina display computer. I previously had a Dell Inspiron. When I went to transfer my iTunes (which was a pain in the first place) I ultimately used home sharing to transfer all of my music. It's been fine for about a