Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
xelatek #1
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
-
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... -
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... -
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... -
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... -
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-... -
-
Koesper #3
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
-
Salines #4
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
-
Phil #5
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.Try this.> [/q]
> I Have same problem, help me.. Tutorial, gudie ... Thank You
>
>
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
-
Sawan #6
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...the>> > 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> 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



Reply With Quote

