Solved

Object References

Posted on 2004-10-08
2
158 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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
Simple PHP Upload Script 11 2,749
Extra Spacing In Pattern Matching 13 329
Site contents shift off page in IE 32 133
Need icon art 9 128
For those who don't know, Adobe Dreamweaver is a popular commercial web editor that enables you to design, build and manage complex websites. The editor is a WYSIWYG (What You See Is What You Get) web editor, which means that you can create your web…
I still run into .cgi files every now and then. In some instances, I actually prefer the simplicity of a .cgi script to other options. Since I use DreamWeaver extensively, what I needed was a way to open .cgi scripts in Dreamweaver. And I wanted to …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

756 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