Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Object References

Posted on 2004-10-08
2
Medium Priority
?
162 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 2000 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

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 …
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…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

704 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