Solved

Object References

Posted on 2004-10-08
2
156 Views
Last Modified: 2010-04-25
Is there any way to find out a specific reference to an object in DreamWeaver?  I come from an extensive FoxPro back ground and in Fox, you can right click on your program and tell it to insert a reference from an object on your screen.  Here's an example:

<form name="fred">
bla
bla
bla
<span>
<input type="radiobutton" name="rbtn" value="a">
<input type="radiobutton" name="rbtn" value="b">
<input type="radiobutton" name="rbtn" value="c">
</span>
</form>

Now, I want to know the specific reference to the second radio button on this form.  Any way to do it or can someone take me to the place I can find out.  What I want to do is reference it like this:

<input type="button" name="whatever" onclick="javascript:document.fred.radiobutton[2].click()">

Thanks in advance.
0
Comment
Question by:bryanhurl
2 Comments
 
LVL 5

Accepted Solution

by:
smaglio81 earned 500 total points
ID: 12265239
I am not exactly sure what your end goal is. But, that won't stop me from guessing.

Make a blank "debugging" page (a blank html page), and add this code to it:

<script language="javascript">
      function whichIsSelected() {
            if( document.fred.rbtn[0].checked ) document.fred.output.value = document.fred.rbtn[0].value;
            if( document.fred.rbtn[1].checked ) document.fred.output.value = document.fred.rbtn[1].value;
            if( document.fred.rbtn[2].checked ) document.fred.output.value = document.fred.rbtn[2].value;
      }
</script>

<form name="fred">

<input type="radio" name="rbtn" value="a" checked />A<br />
<input type="radio" name="rbtn" value="b" onClick="document.fred.rbtn[2].checked = true" />B<br />
<input type="radio" name="rbtn" value="c" />C<br />

<br />

<input type="text" name="output" value="" />

<br /><br />

<input type="button" value="Click Me" onClick="document.fred.output.value = document.fred.rbtn[2].value" />
<input type="button" value="Hit Me" onClick="document.fred.rbtn[1].checked = true" />
<input type="button" value="Whack Me" onClick="document.fred.output.value = document.fred.rbtn.value" />
<input type="button" value="Check it" onClick="whichIsSelected()" />
<input type="button" value="Call it" onClick="document.fred.rbtn[1].click()" />

</form>

Just mess around with this code for a while, and I think you will see how the stuff interacts with one another.

I would give you a more clear & concise answer, but I really don't know that much about Javascript. Your question actually made me want to find out more of its usages; that is why this example code has so many different functionalities. One of the most interesting things, with the above code, is when you press the 'Whack Me' button. The value that is returned to the output text box is 'undefined'; which must have some pretty interesting implications that I do not yet understand.

HTH

Steven
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
How to swtich to classic mode in Adobe Dreamweaver CC? 5 3,304
What's Centering My Images ? 10 310
Create recordset using Dreamweaver PHP and MS SQL 2008 4 557
Responsive CSS Layout? 6 50
Adobe Dreamweaver CS5 is a WYSIWYG web page editor that has advanced HTML, CSS, and Javascript rendering functionality and is probably the most well-known HTML editor available. Much of Dreamweaver's appeal centers around the Design View interfac…
This article is very specific and is only intended to help if you are installing Dreamweaver 8 in a Windows 7 environment with Office 2007 installed.   I'm not sure why Microsoft tends to release OS' that should not be released but they do.  Windows…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question