This topic is locked

Using a FUNCTION

3/11/2008 12:23:40 PM
ASPRunnerPro General questions
W
Wazup author

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=question&id=7846&image=1&table=forumtopics' class='bbc_emoticon' alt=':)' />
I have two functions that I've used in web pages that I'd like to use here.
In particular, one function returns the IP address of the connected remote machine. I'd like to assign that to a record column BEFORE the record is presented for editing or adding and of course before it is added to a table.
The next one returns the PROPER case of text that is entered. I'd like to be able to use this when a user EXITS a field in a form and is entering another field.
For example: User enters first name, then goes to last name. I'd like to use this function after the first name is entered (or alternatively BEFORE the last name is entered). I suppose this is the same thing (Before or After) except I suspect this would be some kind of event.
How can I do this? Do I add my function asp code to a directory (if so how does ASPrunner know about my stuff), or do I do this programatically?
I'm not sure if this would be a Global Event or Table event. I suspect a Table event. But which one and to what field to I assign the result to?
I want do to this Subscription Page.
Hopefully this is clear. If more info is required I can certainly provide it.
Thanks and cheers.

W
Wazup author 3/11/2008

<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=26878&image=1&table=forumreplies' class='bbc_emoticon' alt=';)' />
Okay, got one of them working. I added it as a default.
The other one however uses a COM component so I need to add the function that uses it as well.
I've tried all kinds of events and just get error messages in my browser basically saying "Access is denied to PAGE.ASP"...
Any help would be appreciated.

Sergey Kornilov admin 3/12/2008

You can add your own functions to include/header.asp file (create one if it don't exist).

Then you can call this function from any event.

G
goomba 3/14/2008

Thanks admin, I put the call to my com component where you said and all is well.
Good tip.

W
Wazup author 3/15/2008

You can add your own functions to include/header.asp file (create one if it don't exist).

Then you can call this function from any event.


Hey Sergey, I actually put it in as the "Default" for the record field. Had to tweak my comcomponent a bit, but recompiled and just used it as a normal VBS function call in the default.
But, I'll keep the header thing in mind as well.
Thanks for the pointer. Sometimes, one just over thinks a problem.
Cheers.