|
mcm wrote:
thank you so much for your help! im afraid i tried that and it didnt work - it seems to be ignoring the if statement completely - it always directs itself to the register.asp page.
Hmm odd. Could you email me the output (the actual HTML produced after having run your ASP script) and the ASP file itself?
I noticed you are not closing your OPTION elements which could be a problem and also the actual values from your recordset may be interefering with the select element.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
Simon Walton wrote:
"You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."
|
|
|
|
|
Does anyone have a simple example of how I can implement collapsable tables? (like the way the forum posts work here in DHTML mode)
Basically I want to be able to put a link at the top of a table that when clicked will collapse away the table so that only the header is visable (clicking on the link again would re-expand the table).
Being able to specify (in the html) whether a table starts open or closed would be a bonus too, but I'm not worried about things like making sure only one table is visable (I just want to be able to let users hide away unneeded information)
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
benjymous wrote:
Basically I want to be able to put a link at the top of a table that when clicked will collapse away the table so that only the header is visable (clicking on the link again would re-expand the table).
Quite simple once you figure it out. All you need to do is set the style.display attribute of an element to none to hide it, and block to display it. You can use JavaScript to do this client-side.
You can default it to hidden by using a style="display: none" attribute on the elements.
Here is a very simple example and can be easily expanded for a dynamic page by replacing the element IDs with a variable.
<table>
<tr>
<td style="cursor: hand; background-color: #cccccc;" onclick="javascript:if (document.all.descrip1.style.display == 'none'){document.all.descrip1.style.display = 'block'}else{document.all.descrip1.style.display = 'none'}">Title 1</td>
</tr>
<tr id="descrip1">
<td>Description</td>
</tr>
<tr>
<td style="cursor: hand; background-color: #cccccc;" onclick="javascript:if (document.all.descrip2.style.display == 'none'){document.all.descrip2.style.display = 'block'}else{document.all.descrip2.style.display = 'none'}">Title 2</td>
</tr>
<tr id="descrip2">
<td>Description</td>
</tr>
</table>
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
Simon Walton wrote:
"You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."
|
|
|
|
|
Brilliant!
Lets see if I can get this working with my site
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
more details please - test message for forum
|
|
|
|
|
|
Interesting...is this supported NS6+ also...? Or would you have to use visibility property for that...?
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Interesting...is this supported NS6+ also...? Or would you have to use visibility property for
First off you cannot use (as far as I know) the document.all method of getting the element in Netscape 6+ (Mozilla.) Instead one needs to use the getElementById method, which IE supports as well (I should have used that method rather than document.all but I was feeling lazy .)
display is as far as I know the preferred way of hiding and displaying elements when you want the document to reflow on change. If you use visibility then the document should not reflow as effectively the element is still "there", just not visible. So if you want to hide an element but not have the other elements reflow to fill up the empty space then use visibility . If you want other elements to reflow though, then use display .
For display you have three possible values. block , inline and none . They do pretty much what they say. e.g. By default a span element has a display of inline meaning it will not cause line breaks and will generally flow with the text. By default div elements though have a display of block meaning it will cause line breaks and not flow with the text. You could if you want set the div display attribute to inline and override that default behavouir, making the div flow with the text. This is useful for form elements where you don't want the form to cause any line breaks.
And yes display is supported in NS6+ (Mozilla.) It is part of the W3C CSS standard.
This concludes Paul on CSS 101 Chapter 6...
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
Simon Walton wrote:
"You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."
|
|
|
|
|
Hi,
Does anyone know how to configure IIS 5 so that mail sent using CDONTS does not go to the Badmail queue? I eventually figured out where it was going, but am unsure what to do about it
Thanks
Polymorph
|
|
|
|
|
Megan Forbes wrote:
CDONTS does not go to the Badmail queue
There is a reason it is going there. If your using SMTP to send the mail, is it configured correctly in the code or applicaiton using CDONTS ??
Soliant | email
"the result is that VC7 is the only compiler to generate optimized MSIL" - Stanley Lippman
|
|
|
|
|
Can somebody please explain to me why the following html shows only 2 children? This is the code that .NET spits out for a RadioButtonList. I'm testing this on Netscape 6.2 (browser compatibility tests).
<table id="RadioButtonList1" border="0">
<tr>
<td><input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="Item 1" checked="checked" /><label for="RadioButtonList1_0">Item 1</label></td>
</tr><tr>
<td><input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="Item 2" /><label for="RadioButtonList1_1">Item 2</label></td>
</tr><tr>
<td><input id="RadioButtonList1_2" type="radio" name="RadioButtonList1" value="Item 3" /><label for="RadioButtonList1_2">Item 3</label></td>
</tr><tr>
<td><input id="RadioButtonList1_3" type="radio" name="RadioButtonList1" value="Item 4" /><label for="RadioButtonList1_3">Item 4</label></td>
</tr>
</table>
Here's the Javascript that's reporting 2 children:
var ctrl=document.getElementById("RadioButtonList1");
if (!ctrl.type && typeof(ctrl.firstChild)!='undefined')
{
alert(ctrl.childNodes.length);
}
Huh? Any ideas?
Thanks in advance.
Jamie Nordmeyer
Portland, Oregon, USA
|
|
|
|
|
You're probably picking up a THEAD and a TBODY, which get thrown in just to confuse you!
This should help you find out what the structure is:
NB: I've only tested this on IE6, but it should work!
<html>
<head>
<title>Test Child Nodes</title>
<script language="javascript">
<!--
function Test() {
var lst = document.getElementById("lstControls");
var ctrl = document.getElementById("RadioButtonList1");
if (!ctrl.type && typeof(ctrl.firstChild)!='undefined') {
IterateControl(ctrl, '', lst);
}
}
function IterateControl(oParent, sParent, lst) {
for(var i=0; i<oParent.childNodes.length; i++) {
var item = oParent.childNodes[i];
if (item.tagName) {
var opt = document.createElement("OPTION");
opt.text = sParent + item.tagName;
opt.value = item.outerHTML;
lst.add(opt);
IterateControl(item, sParent + ' ', lst);
}
}
}
function showControl(lst) {
var lbl = document.getElementById("lblControl");
lbl.innerText = lst.options[lst.selectedIndex].value;
}
</script>
</head>
<body>
<table id="RadioButtonList1" border="0">
<tr>
<td>
<input id="RadioButtonList1_0" type="radio" name="RadioButtonList1" value="Item 1" checked="checked" />
<label for="RadioButtonList1_0">Item 1</label>
</td>
</tr>
<tr>
<td>
<input id="RadioButtonList1_1" type="radio" name="RadioButtonList1" value="Item 2" />
<label for="RadioButtonList1_1">Item 2</label>
</td>
</tr>
<tr>
<td>
<input id="RadioButtonList1_2" type="radio" name="RadioButtonList1" value="Item 3" />
<label for="RadioButtonList1_2">Item 3</label>
</td>
</tr>
<tr>
<td>
<input id="RadioButtonList1_3" type="radio" name="RadioButtonList1" value="Item 4" />
<label for="RadioButtonList1_3">Item 4</label>
</td>
</tr>
</table>
<button onclick="Test();">Test</button>
<br />
<select size="20" id="lstControls" onchange="showControl(this);">
</select>
<br />
<div id="lblControl" style="font-family:Courier New; font-size:10pt; color:navy;"></div>
</body>
</html>
|
|
|
|
|
The whole error message is as follows. BTSWebService is the name of my project
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type 'BTSWebService.Global'.
Source Error:
Line 1:
what should be the solution???
please help me out.
|
|
|
|
|
Is it possible to create a page template that contains a server-side <form> element? I would like to create a template that contains a few server-side controls.
I've played around with creating a template with a <form>, but it seems the only <form> element I can create on the template is an HTMLForm.
When I run a page that inherits from this template, the page has no VIEWSTATE, and cannot do postbacks. If the <form> is on the page instead of on the template, the page does have VIEWSTATE and postbacks work correctly.
|
|
|
|
|
Has anyone used the RichTextBox ASP.NET control in a project yet?
So far it looks very good and exactly what we need for our CMS, but I do not want to get my hopes up all over again and then have them dashed
Any opinions appreciated, ta.
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
Simon Walton wrote:
"You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."
|
|
|
|
|
I haven't used it, but it's easy enough (and cheaper ) to roll your own.
I've got a version wrapped up as an HTML behaviour and a few supporting pages. It doesn't have the design-time support and toolbar customization, but the basics are there:
http://www.trinet.co.uk/trinet/feedback.asp[^]
|
|
|
|
|
Richard_D wrote:
but it's easy enough (and cheaper ) to roll your own.
Yeah we tried to roll our own for a project once (I had three days in which to do it though which bites.)
The basics are all pretty easy to do using IE. It is when you get to more complex features, such as applying CSS classes, that things start to unravel (and which the RichTextBox seems to do well.)
Also we need to output XHTML compliant code, though I recently figured out I can pipe-line HTML Tidy into the solution to get this done.
There were lots of niggly issues we ran into when doing our own, which RichTextBox seems to get around.
Richard_D wrote:
http://www.trinet.co.uk/trinet/feedback.asp[^]
Looks great. How can we make use of it in a commercial project? (not for re-sell but a bespoke CMS system for our clients)
i.e. What are your licensing terms?
regards,
Paul Watson
Bluegrass
Cape Town, South Africa
Simon Walton wrote:
"You come across a lot of people who call themselves realists, when they are actually pessimists attempting to look intelligent."
|
|
|
|
|
Paul Watson wrote:
Also we need to output XHTML compliant code,
I can't guarantee that it would be 100% XHTML compliant, but it does have a good go. The tags and attribute names will be in lower case, attribute values will be quoted, all tags will be closed, and all tags will be properly nested.
Paul Watson wrote:
What are your licensing terms?
$80 (US), or £57 (GBP), including source code.
The current properties are below. I keep "playing" with it, so it might get more features!
Properties:
- formname
- Name of the form element
- width
- Css width for this element
- height
- Css height for this element
- value
- HTML content. If not specified, the value is taken either from the element specified in formname (if it exists), or the innerHTML of the element.
- usebr
- True to use <br /> on Enter. False (or not specified) to use <p>
- cssurl
- Full Url to the Css file to use
- includeSource
- Allow access to HTML source?
- includeSpelling
- Allow user to run spell-checker?
- includeTable
- Allow user to insert tables?
- includeSymbol
- Show a drop-down list of symbols
- includeCurrSymbol
- Include currency symbols
- includeTMSymbol
- Include TM, (c), etc
- includeFmtSymbol
- Include formatting symbols
- includeAccentSymbol
- Include accents
- includeMathSymbol
- Include mathematical symbols
- includeArrowSymbol
- Include arrows
- limit
- Maximum number of characters to allow (0 or not specified = unlimited
- imgdir
- Image folder for toolbars
- basepath
- Base Url for images - use blank for current
Standard Inserts:
If includeSymbol = true, standard inserts can be added by including the following within the element:
<div class='HTML_INSERT' style='display:none;' text='[CAPTION OF INSERT]'<
[HTML to insert]
</div>
Client Side Events:
All events have the following properties:
- srcElement
- This element
- srcHTML
- The HTML editor
- returnValue
- Set to false to prevent processing
Events:
onbeforeparastyle
Fires before applying a paragraph style
- newStyle
- The style to be applied
onbeforefontsize
Fires before changing the font size
- newSize
- The new size
onbeforefontname
Fires before changing the font name
- newFont
- The new font
oninserttable
Fires before inserting a table
- tableAttributes
- Attributes for the table
- showDialog
- Return false to insert without prompting
onsetcolor
Fires before setting the foreground or background colour
- mode
- BG or FG
- newColor
- Return a colour
- showDialog
- Return false to set the colour without prompting
- dialogUrl
- Url of the colour dialog
- dialogAttributes
- Attributes for the colour dialog
oncheckspelling
Fires before the spell-checker window is opened
- dialogUrl
- Url to the spell-checker
- dialogWidth
- Width of the window
- dialogHeight
- Height of the window
oninsertimage
Fires before inserting an image
- showWarning
- Return false to prevent the warning message
- showDialog
- Return false to prevent the Url prompt
- imageUrl
- Url of the image
oninsertlink
Fires before inserting a hyperlink
- showDialog
- Return false to prevent the Url prompt
- Url
- Url for the link
oninsertsymbol
Fires before inserting a symbol
- symbol
- Symbol to insert
Example
<html>
<head>
<title>Test</title>
<link rel="stylesheet" href="htmleditor_ctrl_xp.css" />
<script language="javascript">
<!--
function test() {
alert(document.getElementById("test").value);
}
function testLink() {
event.showDialog = false;
event.Url = "http://www.codeproject.com/";
}
</script>
</head>
<body>
<div
style="width:100%; behavior:url(htmleditor.htc);"
id="testHTML" formname="test"
includeSymbol="1"
includeAccentSymbol="0" includeArrowSymbol="0"
includeMathSymbol="0" includeFmtSymbol="0"
usebr="1" oninsertlink="testLink()"
>
<!--The form element. The editor will take it's value from this.-->
<textarea name="test" id="test" rows="5" cols="50">
<p><em>Test</em> of HTML HTC</p>
</textarea>
<!--The easiest way to check whether the editor was run from the server:-->
<input type="hidden" name="test_IsHTML" value="0" />
<!--A custom insert.-->
<div class="HTML_Insert" style="display:none;" text="Disclaimer">
<hr size="1" color="#eeeeee" noshade />
<span>Well, this works then!</span>
</div>
</div>
<button onclick="test();">Test</button>
</body>
</html>
IE5+ users will get the editor, everyone else will get the standard text-box.
|
|
|
|
|
Alternatively, if that's too much, this[^] article might be of interest.
|
|
|
|
|
Is it possible for a web browser to access the users serial port to receive data from a peripheral to be used in a website? Such as having a small barcode scanner with barcodes scanned in it, the user then goes to a website to order the items scanned, and the webite reads the data from the scanner and compares the scanned items with a central database. If so, what technology?
|
|
|
|
|
Do not use just a web browser. Create a separate app that will scan barcodes, and then send the data using eg HTTP protocol.
You can also put a web browser control in your app, or create a plug-in for IE!
If your clients get barcodes scanners, barcodes, they can also get an additional app!
Ñ There is only one MP Ð
|
|
|
|
|
Hello,
i can get the date of the last modify of a document using document.lastModified. But is it possible to get the last modify date of any file using a function plus a pointer to the file?
The point is, i want show the user the upload time of a downloadable file.
Thanks,
Dominik
|
|
|
|
|
Use "Scripting.FileSystemObject" ActiveX scripting,
MSDN reference
function ShowFileAccessInfo(filespec)
{
var fso, f, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFile(filespec);
s = filespec.toUpperCase() + "<br>";
s += "Created: " + f.DateCreated + "<br>";
s += "Last Accessed: " + f.DateLastAccessed + "<br>";
s += "Last Modified: " + f.DateLastModified;
return(s);
}
And I swallow a small raisin.
|
|
|
|
|
Is it possible to do this without ActiveX, in pure JavaScript?
|
|
|
|
|
Wouldn't there be some problems if Javascript itself was able to access the FileSystem ? This would be a security flaw.
If you can use document.lastModified for the current web page, there is no magics behind, that's because the web server puts these info in the HTTP headers.
As a matter of fact, you may use Web-DAV (an extension of HTTP) for what you need, but that brings us very far. See MS SharePoint.
And I swallow a small raisin.
|
|
|
|