Unable to read value of Text Field : Any help?

Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.

  1. #1

    Default Unable to read value of Text Field : Any help?

    I've following DOM structure:
    body
    form
    div1
    div2
    textfield
    button
    div3
    button

    etc.
    [hr]
    For some reason, I am unable to read the value of the textfield. What I am
    doing is...on div2 I've a button, onclick this div2 is hidden & div3 comes on
    the front. But, on trying to read this value of textfield...(where user is
    supposed to enter value), I am trying this:

    --------------------------------------------------------------------------------
    --------------------------------
    var divElements=document.getElementsByTagName('div');
    alert(divElements[1].getElementsByTagName("input")[1].value);

    --------------------------------------------------------------------------------
    --------------------------------
    Alert returns ampty alert. :(

    What am I doing wrong?

    Regards
    Webcoder

    webcoder Guest

  2. Similar Questions and Discussions

    1. Radio btn makes text field equal value of different text field
      What I am trying to do is when someone clicks on the YES radio button I want the text field called MYTEXT to equal the text field named DATE. The...
    2. CS: Unable to Read .Eps and .AI Files Burned to CD
      I have several eps and ai files which I have backed up to a CD. I can copy them back to my PC and have no problem accessing them. But when I try to...
    3. Upload (unable to read file)
      hi, i´m trying to upload a file. I tried many ways but it always return the same error... Unable to open c:\file.jpg for reading. the file...
    4. unable to display public text field of object in ArrayList in a bound DataGrid
      I have a very simple public class X, whose fields are all public. I create an ArrayList that contains a series of instances of X. Then I bind a...
    5. Unable to read httpcontext during session end
      In my application, I have users that are registered in SQL Server. When they login, a flag is set to indicate they are logged in (dll). The...
  3. #2

    Default Re: Unable to read value of Text Field : Any help?

    Try something similar to:

    var myDivs = dw.getDocumentDOM().getElementsByTagName("div");
    paramObj.div__tag = myDivs[0];

    alert(myDivs[0]);


    envision3d Guest

  4. #3

    Default Re: Unable to read value of Text Field : Any help?

    Hi envision3d,

    Thanks for your response. I am now able to capture the values. :)
    Now...interestingly I have landed in to a different problem.

    Basically, I need to put a javascript on the head part of the document. So,
    what I have done is:

    var theHeadNode=curDOM.getElementsByTagName('head');
    var rtnScript="<script content...>";
    theHeadNode[0].innerHTML+=rtnScript;

    Interestingly...if I keep my cursor outside the DOM (you will get clarity by
    looking at the attached screenshot), it throws an error. How do I prevent this?
    The line number showed in the error has following code:

    theHeadNode[0].innerHTML+=rtnScript;

    Can you please advise on this?

    Thanks in advance.
    Regards
    Webcoder

    PS: I have uploaded a snapshot at:
    [url]http://www.innindia.com/extensions/images/dw_error.JPG[/url]

    webcoder Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139