|
You see, I could make a particular page error
by adding errorme('')<script> to my forum
How can i avoid this at my site asp?
|
|
|
|
|
Anyone know how to attach multiple conditions to a click event?
For example if a user clicks on a submit button....how can I specify an if then else condition?
i know its pretty easy but im new to Jave Script.
thanks in advance.
|
|
|
|
|
Just call a function in the onClick() event and do what you want in that function.
|
|
|
|
|
please teach me
may be... use the CreateObject ??
or... i have no idea.
tell me tell me loving you ( -_-... sorry )
bye
|
|
|
|
|
Hi,
You can create any COM object like this:
Set MyObj = Server.CreateObject("Object.Prog.ID")
....
Set MyObj = Nothing 'Destroying object
If you still do not fill comfortable about it... Check our company's WEB site at www.dundas.com. We have FREE ASP components like pie chart and mailer with examples of how to use them in ASP pages.
Regards,
Alex Gorev,
Dundas Software
|
|
|
|
|
Has anyone else here worked with banners that are enclosed in an IFrame?
I have drop-down menus on my site (very similar to microsofts) and they go under the banners instead of over them.
Any help would be appreciated.
-Dan Smith
dans@3dgamedev.com
|
|
|
|
|
We have a problem. Here it is: A user is filling out a form and suddenly
they get to a text box that asks for an employee number. The problem is
that the user does not know the employee number, but they know the name of
the employee. The employee table has 65,000 names. That is much too long
a list to show in a list box - not to mention the load time over the
internet.
We could have the user click on a search button next to the employee number
text box. The search button could initially open a search page like the
typical page that we use and it would show a list based on the entry in the
search text box. If the user clicks on an employee, it could automatically
fill the text box back on the original form and display the correct
employee number. The big question is how do we jump back and how do we
update the original form?
|
|
|
|
|
This is pretty simple... You can create a HTML modal dialog or a search window, and since you know the owner (Parent window), you can access the document object and all it's elements. Then when the user clicks OK on your search dialog, you can update the field with the employee number for the user selected...
Hope this helps,
-Erik
|
|
|
|
|
Yep, me again folks. I'm trying to get into DHTML but the various browsers are getting in my way.
Does anyone know of any bugs in IE5's implementation of DHTML? I had a fairly simply page running perfectly in IE4 here at work, but when I took the same page home to IE5 it doesn't work the same (it doesn't work completely, basically).
All the code did was create two hidden DIVs of a certain size with some text and an IMG tag in each, and a third DIV, initially hidden, with some text and a combo box. That third DIV is then shown, and should be the only item visible in that document, in the centre.
In IE5, the text from the third DIV shows up, but the combo does not - and the text is not in the same position as it was in IE4 - it is further down (possibly because it is in a table and v-centred). But why doesn't the combo box show?!!
|
|
|
|
|
I have found that if the text and other stuff you put in a DIV-/DIV block is too big, it just spills out the bottom. I know that you can control this behaviour by using the overflow property in the stylesheet. My question is, is it possible to calculate how big the DIV needs to be to accommodate all of its contents fully? IT is not really good enough to design it big enough at your own end, because other people might be using larger default fonts in their browser (in IE, at least, you can choose the size of the standard font), and so it might not fit then. IF you could calculate the size at run time in their browser, it would ensure the DIV was large enough (and would then enable the code to accurately centre it in the page, for example).
|
|
|
|
|
Set the width of the DIV block to a fixed value and make its position absolute so you can work with it under IE and Netscape.Create it as invisible. The browser should then set its height to a value so that the block will accomodate its contents. Now you can retreive this value with:
IE: document.all["strID"].offsetHeight
Netscape: document.layers["strID"].clip.height
This way you have the dimensions of the block (you know the width because you fixed it at the beginning) and you can center it in the browser window. Don't forget to make the block visible!
Bye
|
|
|
|
|
OK, thanks - I'll try that. At the moment I can't even get code to work consistently between IE4 and IE5 - don't you just love the concept of backwards compatibility? Microsoft have clearly never heard of it.
|
|
|
|
|
Sorry, this is slightly lengthy to give all possible information.
I'm having difficulty retrieving the width and height (or anything, for that matter) from a block defined with a DIV. I predefined its position and size using the standard stylesheet approach, so it DEFINITELY has a position and size (and I can see it occupy those dimensions, so I know it works).
I am trying to get the size like this:
function GetDIVObject(strID)
{
var Object = null ;
switch (g_iBrowser) // Assume this is correctly set.
{
case BROWSER_IE :
Object = document.all[strID].style ;
break ;
... and other cases for other browsers, I'm using IE5...
}
}
var Object ;
Object = GetDIVObject("CategorySelect") // This name is OK
// The object returned is not null, as the browser is
// correctly recognised as IE.
I have tried:
iWidth = Object.width
iWidth = Object.posWidth
iWidth = Object.pixelWidth
but none of them return anything useful - the first returns blank or undefined, the others return 0.
The DIV block is defined not directly into an HTML page but
by document.writeln() statements creating the HTML lines - but this MUST work because I do see the created DIV (it contains a combo box). The call to get the size IS located AFTER the declaration of the DIV.
I am trying to do this so that I can centre the DIV in the available client space.
Any ideas?
|
|
|
|
|
I think the problem is in the function GetDIVObject(strID). Try the following:
return document.all[strID].style;
instead of:
Object = document.all[strID].style;
because you're assigning the return value of the function to Object.
|
|
|
|
|
Thanks, but this is not the problem. There is absolutely no difference between
---
Object = document.all[strID].style ;
return Object ;
---
and
---
return document.all[strID].style ;
---
It is a standard C / C++ way of preparing a return value, even for an object (or object pointer).
I managed to get it working by starting from scratch, although I haven't found out what was wrong with it the first time yet.
|
|
|
|
|
If you look at the code in your 1st message you will see that you didn't do a
return Object;
and that's why I told you to try with
return document.all[strID].style;
perhaps you did it in the original code but forgot to write it in your 1st message. If you still want to know what the problem was, I could try to find it if you send me all the code to
haykel@cs.tu-berlin.de
Bye
|
|
|
|
|
Oops, I see you're right and I missed it from the sample code. So much for "giving all possible information" {:v( I DID, however, have it in the actual code.
I appreciate the offer of help, but let me try to find the problem first - it's the best way to learn. If I can't find it, I'll come back to you.
Thanks.
|
|
|
|
|
I need a function (in ASP) that will go through an RTF string and return plain text or HTML. Or even string manipulation suggestions. Thanks
|
|
|
|
|
Hi all,
I'm wondering if there is a simple way to allow a single form to have two "actions". ie. the form is declared as:
...
When the submit button is pressed, all data is sent to MyPage.asp. What I'd like to do is have another "submit" button that sends all data to MyPage2.asp (for example). Effectively I'd like to have a form that allows the user to choose which page the form's data is sent to.
|
|
|
|
|
You can't send to multiple pages. What I do is to evaluate the pressed button in the receiving form "MyPage.asp" and then branch accordingly.
if button 1 is pressed then
xxxxx
else
yyyyy
end if
With IIS 5.0, there is a Transfer()-method to let the server do this. In IIS 4.0 there is no such method. One could work-around with #include statements.
|
|
|
|
|
Hmm. I was hoping there was a possible javascript solution. Oh well
|
|
|
|
|
Hi Chris!
You can put one or more buttons on the form and then process their OnClick events, specifying the form's action and submitting the data. See example below...
Regards,
Alex Gorev,
Dundas Software.
********************************************************
function OnUpload() {
document.form1.action = "test2.asp"
document.form1.submit();
}
|
|
|
|
|
This did the trick - except that in IE5 I got an error stating that the document.form1.submit(); method was not a member of document.form1 - so I left it out and it worked fine.
Setting document.form1.target = "page2.asp" answered my second question (that I'd not actually posted) about having the form open the page in a separate window.
Gotta love javascript...
|
|
|
|
|
I don't think it will work on a Netscape client... very few tags support the OnClick etc events in Netscape.
|
|
|
|
|
Oops - I'm wrong! )
|
|
|
|