/    Sign up×
Community /Pin to ProfileBookmark

How to Activate a Form Remotely

I have created a form on a page, is there a way to activate that form from another location through codes?

Let’s say I created a “View Results” form on page 1 then do some stuff on page 2, which then includes a command to activate the “View Results” form from page 1, etc.

Thanks in advance…

Tou Yang
Wisconsin

to post a comment
Full-stack Developer

10 Comments(s)

Copy linkTweet thisAlerts:
@ray326Oct 31.2005 — Define what you mean by "activate."
Copy linkTweet thisAlerts:
@txyaajauthorOct 31.2005 — What I meant was like an analogy to a function, which I want to be able to call the function (form in this case) from another page or specifically from a drop-down menu item. I could do it at this point, but I had to recreate the form inside the menu, which essentually duplicates the button/image on the menu. I could live with that but I was hoping there's another way of doing it such assign an onClick event to just the menu caption so it doesn't look so gaudy.
Copy linkTweet thisAlerts:
@ray326Nov 01.2005 — Sorry to be so dense but I'm still not getting it. Maybe someone else does or you can try restating it again a different way.
Copy linkTweet thisAlerts:
@txyaajauthorNov 01.2005 — Ok, I was comparing Javascripting/HTML to something like what you could do in VB. In VB once you created a function/subroutine, you could assign that module to a menu item or invoke it from any where by calling the module.

Is that possible in Javascripting? Right now I got it to work but not by calling the "form" previously created in another page but by recreating the form (button) inside the menu as seen in the first item of the attachment. I would prefer to use the second item and assign an onClick event to that instead of using the button...

[upl-file uuid=24d22121-595e-46d5-ba8f-b0f095de3a4f size=10kB]menu.jpg[/upl-file]
Copy linkTweet thisAlerts:
@ray326Nov 01.2005 — It just looks like a drop down menu to me. The look of it can be controlled with CSS and the behavior with Javascript.
Copy linkTweet thisAlerts:
@txyaajauthorNov 02.2005 — Exactly - it's a drop-down menu with the form code creating the button as a menu item instead of a text caption. You said the button's look could be controlled by CSS or Javascript does that mean there's no way to assing an onClick property to a text caption of "View Results" so that it will invoke the form created elsewhere?
Copy linkTweet thisAlerts:
@MstrBobNov 02.2005 — Are you asking if you can add 'onclick' to something other than a button? Yes, you can. Check out the documentation for the [URL=http://www.w3.org/TR/html4/interact/scripts.html#adef-onclick]onclick attribute[/URL]. You can add it to most elements. Like:

[code=html]
<span onclick="viewResults():">View Results</span>
[/code]
Copy linkTweet thisAlerts:
@txyaajauthorNov 02.2005 — Yes, something like that. I tried a few things but it didn't work. Now I think I will have to find a way to write the function which contains the "view results" codes so that when I click on the menu item the function would fire up... :rolleyes:

Thanks-MstrBob
Copy linkTweet thisAlerts:
@kelly23Nov 02.2005 — You can create the javascript in a .js file (no opening and closing script tags) and name it view_results.js, then place a reference to it in the head of each page where you want to use it:
<i>
</i>&lt;head&gt;
&lt;script language="javascript" type="text/javascript" src="view_results.js"&gt;&lt;/script&gt;
&lt;/head&gt;


Then, call it from a text link or whatever.

kelly

[b]Edit:[/b] Call the [b]function[/b] from a text link.
Copy linkTweet thisAlerts:
@txyaajauthorNov 02.2005 — Thanks Kelly, I will give that a try....
×

Success!

Help @txyaaj spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...