Skip to main content

Posts

Showing posts from October, 2007

Nesting a Panel within a Tabbed Panel (input.asp)

If you are going to put a panel within the first tab of the Tabbed panel there are no special requirements you need to take. However, if you put the panel within the second tab, it needs to be hidden from view initially. To do this: <% input.startTabbedPanel "Tab 1, Tab 2, Tab 3" %> <% input nextTabbedPanel %> <% set list = content.createList("some_value") %> <% list.setParam "panel_stylesheet", "visibility: hidden; display: none;" %> <% do while list.nextPanel() %> <table> <tr><td>somestuff</td></tr> </table> <% loop %> <% input.nextTabbedPanel %> <% input.endTabbedPanel %> That's it. NOTE: that for the panel_stylesheet line the css needs to have ; at the end or this won't work.

Deleting / Cleaning up Content Fields another Method

Sometimes content.getTable() doesn't work in the post_input.asp file the reason being is that content.getTable() pulls its data from the input.asp file where as asset.getContent() pulls data from the database. So here's the method for deleting old data that could be stuck in the database... set content_fields = asset.getContent(content.item("_cmsId")).getTable() for each itm in content_fields if itm = "somestring or you can do a Regex match here" then asset.deleteContentField(content.item("_cmsId"), itm) end if next

document.getElementByName()

<input type="text" name="somename" value="somevalue1" /> <input type="text" name="somename" value="somevalue2" /> <input type="text" name="somename" value="somevalue3" /> <script type="text/javascript"> var x = document.getElementByName('somename'); // document.getElementByName() returns an array where //x[0].value == "somevalue1"; //x[1].value == "somevalue2" </script> Note: getElementByName() only works for form elemnts if you need other elements a workaround would be to use var element = getElementByTagName() and assign a class to each element then you could look for that class using if element[index].className == "somename".