© 2004 Microsoft Corporation. All rights reserved.
Figure 1 SQL Query and Output

The Query
SELECT TOP 100 PERCENT dbo.Keywords.Keyword, dbo.Topics.TopicUrl
FROM  dbo.Keywords INNER JOIN
               dbo.RelatedTopics ON dbo.Keywords.KeywordID = 
dbo.RelatedTopics.KeywordID INNER JOIN
               dbo.Topics ON dbo.RelatedTopics.TopicID = 
dbo.Topics.TopicID
ORDER BY dbo.Keywords.Keyword, dbo.Topics.TopicUrl FOR XML AUTO
The Output
<dbo.Keywords Keyword="FloatPlane" KeywordID="1">
    <dbo.Topics TopicUrl="http://www.cs-ent.com" TopicID="3"/>
    <dbo.Topics TopicUrl="http://www.seaplane.org" TopicID="2"/>
</dbo.Keywords>
<dbo.Keywords Keyword="ForSale" KeywordID="2">
    <dbo.Topics TopicUrl="http://www.aso.com" TopicID="1"/>
    <dbo.Topics TopicUrl="http://www.cs-ent.com" TopicID="3"/>
</dbo.Keywords>
Figure 2 Disabling Checkboxes
<select id=district onChange='toggle_disable(this, 0, "state");'>
    <option selected>choice 1</option>
    <option>choice 2</option>
    <option>choice 3</option>
</select>

<select id=state onChange='toggle_disable(this, 0, "district");'>
    <option selected>choice 1</option>
    <option>choice 2</option>
    <option>choice 3</option>
</select>

<script language=jscript>
    function toggle_disable( object, toggle_index, disable_obj )
    {
        // test based on passed in index 
        if ( object.options[toggle_index].selected != true )
        {
            //disable object by dom id
            document.all.item(disable_obj).disabled = true;
        }
        else
        {    
            // enable object by dom id
            document.all.item(disable_obj).disabled = false;
        }    
    }
</script>
Figure 3 Setting the Onsubmit Handler
function captureSubmit() 
    { 
            var i; 
            for (i = 0; i<parent.testpage.document.forms.length;i++) 
            { 
                    parent.testpage.document.forms(i).onsubmit = 
                        captureSubmitSink; 
            } 
    } 
    
    function captureSubmitSink() 
    { 
            timeFormSubmit(this); 
    } 

MSDN Magazine Blog

MSDN Magazine Right Rail

14 Top Features of Visual Basic 14: The Q&A
Leading off the feature in the January issue of MSDN Magazine is Lucian Wischik’s fantastic look at Visual Basic .NET 14. As Wischik writes, the newes... More...
Wednesday, Jan 7
Big Start to the New Year at MSDN Magazine
Folks, things are hopping over here at MSDN Magazine. We are kicking off the new year with a pair of issues: Our regularly scheduled January issue and... More...
Friday, Jan 2

More MSDN Magazine Blog entries >


Receive the MSDN Flash e-mail newsletter every other week, with news and information personalized to your interests and areas of focus.