Dreamweaver Extension Help - find the form name

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

  1. #1

    Default Dreamweaver Extension Help - find the form name

    I am building a dreamweaver 8 extension. So far everything is working great.
    The extension inserts some javascript after filling out a form. However, I
    would like to prepopulate the form with some of the information that might
    already be in the document. One of the things i would like to prepopulate is
    the name of the form (if it already exists) on the document. There could
    possibly be multiple forms on the document. But i want to find out which
    document the user is in when he tries to use my "insert object" dreamweaver
    extension. For example, a normal user might already have created a form in
    their document using dreamweaver. After that if the cursor is inside the form,
    when the user decides to use my extension, i want the extension to figure out
    what form name is the user in, so that it can prepopulat the extension form
    with that form name. I hope that makes sense.
    I do know i need to do something like this...

    function initializeUI() {
    var myDOM = dw.getDocumentDOM();
    myDom.thisFormName // this is where i'm lost i don't know how to access that
    specific form name
    }

    But i don't know exactly what i need to do.
    Please help! Thanks.


    xelatek Guest

  2. Similar Questions and Discussions

    1. Map Quest extension for Dreamweaver 8- can't find it!
      I would like to add driving directions / map to a site I'm creating with Dreamweaver 8. I googled around and found this link where this person is...
    2. Can't find this Extension
      Is there a free Dreamweaver MX extension I can download -- that will make drop-down menus, check boxes and radial buttons required elements in a...
    3. can i find this extension
      hi .. i want to view articals in my homapage and long as i add them in my database so they increased in the homepage (like blogs) and if they are...
    4. Dreamweaver Extension
      Is there a user authentication extension for Dreamweaver MX Version 6? My version does not seem to have this function listed in the Server Behaviors...
    5. Where to find the QuickTime extension
      I have tried searching the macromedia site for the quicktime extension but can't find it, plus I can't seem to find it from my web searches either-...
  3. #2

    Default Re: Dreamweaver Extension Help - find the form name

    Help! Anyone!
    xelatek Guest

  4. #3

    Default Re: Dreamweaver Extension Help - find the form name

    i''m just guessing here, but cant you access it through the dom
    like document.forms[0].name or something like that?

    (perhaps this sends you in the right direction, but dont try to literally
    copy-paste it, because i dont understand half of it myself)

    Regards,
    Casper de Groot

    Koesper Guest

  5. #4

    Default Re: Dreamweaver Extension Help - find the form name

    [q]Originally posted by: xelatek
    I am building a dreamweaver 8 extension. So far everything is working great.
    The extension inserts some javascript after filling out a form. However, I
    would like to prepopulate the form with some of the information that might
    already be in the document. One of the things i would like to prepopulate is
    the name of the form (if it already exists) on the document. There could
    possibly be multiple forms on the document. But i want to find out which
    document the user is in when he tries to use my "insert object" dreamweaver
    extension. For example, a normal user might already have created a form in
    their document using dreamweaver. After that if the cursor is inside the form,
    when the user decides to use my extension, i want the extension to figure out
    what form name is the user in, so that it can prepopulat the extension form
    with that form name. I hope that makes sense.
    I do know i need to do something like this...
    [/q]
    I Have same problem, help me.. Tutorial, gudie ... Thank You


    Salines Guest

  6. #5

    Default Re: Dreamweaver Extension Help - find the form name

    > a normal user

    What is it ?
    :-)

    > One of the things i would like to prepopulate is
    > the name of the form (if it already exists) on the document.
    > [/q]
    > I Have same problem, help me.. Tutorial, gudie ... Thank You
    >
    >
    Try this.
    Tested in a command file. You can adapt it to your needs, just get rid of the
    alert().

    //---------------------------------
    function initializeUI(){
    var tag = 'form';
    var attribute = 'name';

    // resultat = Object Element if found, empty if not
    var resultat = getSelectionTag(tag.toUpperCase());

    if (resultat) { // tag found
    if (resultat.getAttribute(attribute)) {
    alert(resultat.getAttribute(attribute)); // attribute value found
    }
    else {
    alert('Attribute ' + attribute + ' not found');
    }

    }
    else {
    alert('Tag '+ tag + ' not found');
    }
    }

    //Check if selection or any parent of the selection is a tag 'tag',
    //and return the tag node if found.

    function getSelectionTag(tag) {
    var retVal = "";
    var dom = dw.getDocumentDOM();
    var node = dom.getSelectedNode();

    while (node.nodeType != Node.DOCUMENT_NODE) {
    if (node.nodeType == Node.ELEMENT_NODE && node.tagName == tag) {
    retVal = node;
    break;
    }
    else node = node.parentNode;
    }

    return retVal;
    }
    //---------------------------------------------------





    Phil Guest

  7. #6

    Default Re: Dreamweaver Extension Help - find the form name

    Hello Phil,

    I know this can sound funny, but i want to know how to develop DMX
    extensions.

    It is very simple, something similar to this
    [url]http://www.earlyimpact.com/productcart/dreamweaver/index_1.asp[/url]

    Can any one pl guide me?

    Regards,
    Sawan
    "Phil" <nomail@nospam.com> wrote in message
    news:eb9epa$691$1@forums.macromedia.com...
    > > a normal user
    >
    > What is it ?
    > :-)
    >
    >
    > > One of the things i would like to prepopulate is
    > > the name of the form (if it already exists) on the document.
    >
    > > [/q]
    > > I Have same problem, help me.. Tutorial, gudie ... Thank You
    > >
    > >
    >
    > Try this.
    > Tested in a command file. You can adapt it to your needs, just get rid of
    the
    > alert().
    >
    > //---------------------------------
    > function initializeUI(){
    > var tag = 'form';
    > var attribute = 'name';
    >
    > // resultat = Object Element if found, empty if not
    > var resultat = getSelectionTag(tag.toUpperCase());
    >
    > if (resultat) { // tag found
    > if (resultat.getAttribute(attribute)) {
    > alert(resultat.getAttribute(attribute)); // attribute value found
    > }
    > else {
    > alert('Attribute ' + attribute + ' not found');
    > }
    >
    > }
    > else {
    > alert('Tag '+ tag + ' not found');
    > }
    > }
    >
    > //Check if selection or any parent of the selection is a tag 'tag',
    > //and return the tag node if found.
    >
    > function getSelectionTag(tag) {
    > var retVal = "";
    > var dom = dw.getDocumentDOM();
    > var node = dom.getSelectedNode();
    >
    > while (node.nodeType != Node.DOCUMENT_NODE) {
    > if (node.nodeType == Node.ELEMENT_NODE && node.tagName == tag) {
    > retVal = node;
    > break;
    > }
    > else node = node.parentNode;
    > }
    >
    > return retVal;
    > }
    > //---------------------------------------------------
    >
    >
    >
    >
    >

    Sawan 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