Skip to comments.
Need Javascript Help
Posted on 10/10/2003 5:43:42 PM PDT by paul544
Anyone real good with Javascript?
I need help creating a script that will take input from a form and use it to create a url and then go to it. The result must be based on information that the user inputs.
Any help would be greatly appreciated...
TOPICS: Technical
KEYWORDS: java
Navigation: use the links below to view more comments.
first 1-20, 21-23 next last
1
posted on
10/10/2003 5:43:42 PM PDT
by
paul544
To: paul544
There are websites full of javascript education and eample scripts...
creating a script that will take input from a form and use it to create a url and then go to it.
hhhhmmmm. What would that be used for?
I'll do a quick search....
2
posted on
10/10/2003 5:46:41 PM PDT
by
GeronL
(Please visit www.geocities.com/geronl)
To: All
The Free Republic Lifeform
"... This is a wonderful description of what Free Republic really is. It is a living and evolving Life Form to battle the left wingers and those who would destroy this country!
The Free Republic Life Form enables us to discover the truth about what is happening. We can avoid the spin of the major mediots as they work 24/7 to weaken this country. We come to the Free Republic Life Form to find the truth! ...
Free Republic needs a constant infusion of cash to keep the Free Republic Life Form alive, viable and to grow. If we believe in Free Republic, we must donate each month or quarterly to keep this incredible life form alive...
Good stewardship is what this world needs, not good intentions. Good conservative stewards will insure that the Free Republic Life Form continues to grow, be viable and thrives!"
Thank You for your support!
Click The Logo To Donate
Or mail checks to
FreeRepublic , LLC
PO BOX 9771
FRESNO, CA 93794
or you can use
PayPal at Jimrob@psnw.com
3
posted on
10/10/2003 5:47:45 PM PDT
by
Support Free Republic
(Your support keeps Free Republic going strong!)
To: paul544
http://javascript.internet.com/
http://www.javascriptkit.com/
http://www.javascriptkit.com/
These sites my be helpful
4
posted on
10/10/2003 5:48:19 PM PDT
by
GeronL
(Please visit www.geocities.com/geronl)
To: GeronL
www.javascript.com
5
posted on
10/10/2003 5:48:49 PM PDT
by
GeronL
(Please visit www.geocities.com/geronl)
To: paul544
6
posted on
10/10/2003 5:49:21 PM PDT
by
SunStar
(Democrats piss me off!)
To: paul544
It might be easier with PHP.
No, don't ask me how.
7
posted on
10/10/2003 5:50:05 PM PDT
by
Flyer
(Visit the Houston Chapter - http://houstonliberty.com/forums/ * (when it works)
To: SunStar
Thanks for the help. I've been looking forever on this.
The drop down I can do. But I need the user to be able to dynamically "create" a web address.
I need it for work. We go to intranet sites that have the same format but different variables in the address. I want to be able to enter just the variables and have it go right to the page without having to type out the whole address.
8
posted on
10/10/2003 5:54:50 PM PDT
by
paul544
(3D-Joy OH Boy!!!)
To: paul544
Type site here:
To: Tennessean4Bush
??? Not following.
10
posted on
10/10/2003 6:32:23 PM PDT
by
paul544
(3D-Joy OH Boy!!!)
To: paul544
I think what you are asking is pretty simple...
Here is something I created to search Free Republic.
- The code below pops up a javascript window that asks you to enter one or more words you want to search F.R. for
- It takes your responses, and builds the appropriate URL string with the special options (ANY of the words) and (SORT BY DATE)
- It then opens a NEW window and calls up the new URL (not disturbing the original window)
- This is VERY HANDY for doing a last-second search for some breaking news headline to make sure you are NOT creating a duplicate post.
Ok, here is the code...
Test this by selecting ALL of it, and copying it to your browser LOCATION field, (or better yet create a bookmark on you personal toolbar for this)
Javascript:var lmnop=prompt('Search F.R. for ANY word(s):','');var urlpath='http://www.freerepublic.com/focus/news/search?m=any&o=time&s='+lmnop;{void(window.open(urlpath,lmnop))}
To: FL_engineer
Yes! Very very close to what I am looking for. Two questions, can the be turned into a form within a webpage and can it be two parts?
ie - '
http://run'+(1st variable here)+(2nd variable here)+':4000'
Thank you SO much for the help.
12
posted on
10/10/2003 6:59:30 PM PDT
by
paul544
(3D-Joy OH Boy!!!)
To: paul544
Sorry, tried to paste in an actual form and form var and it did not work. Everywhere I have a "[" below replace it with a "<".
[HTML>
[HEAD>
[SCRIPT LANGUAGE="JavaScript">
function gotosite() {
lcSite = ""+document.forms[0].MyInput.value ;
if (lcSite.toUpperCase().indexOf("HTTP://")[0 && lcSite.toUpperCase().indexOf("HTTPS://")[0) {
lcSite = "http://"+lcSite;
};
window.location = lcSite ;
};
[/SCRIPT>
[/HEAD>
[BODY>
[SAMP>
[FORM NAME="MyForm" ACTION="javascript:gotosite()">
Type site here: [INPUT NAME="MyInput" TYPE="Text">
[INPUT NAME="MySubmit" TYPE="Submit" VALUE="Go">
[/FORM>
[/SAMP>
[/BODY>
[/HTML>
To: Tennessean4Bush
Oops, line above should read:
if (lcSite.toUpperCase().indexOf("HTTP://")<0 && lcSite.toUpperCase().indexOf("HTTPS://")<0) {
To: paul544
Highlight the above text and paste into a straight text document (use notepad). Then replace all the "[" with "<" and save as "MyPage.htm". Open up the resulting file in your browser.
Enjoy!
.
To: paul544
Try this:
<html>
<head><script>
function goToURL(){
document.location="http://" + document.forms[0].var1.value + document.forms[0].var2.value + ":4000/";
}
</script>
</head>
<body>
<form onSubmit="return false;">
<input type='text' name='var1'>
<input type='text' name='var2'>
<input type='submit' onClick="goToURL()">
</form>
</body>
</html>
17
posted on
10/10/2003 7:45:07 PM PDT
by
yevgenie
To: Tennessean4Bush
Thanks a bunch. will test soon and let you know.
18
posted on
10/10/2003 7:47:42 PM PDT
by
paul544
(3D-Joy OH Boy!!!)
To: yevgenie
Thanks. I'll let you know how it goes...
19
posted on
10/10/2003 7:48:02 PM PDT
by
paul544
(3D-Joy OH Boy!!!)
To: paul544
well you certainly could ask two questions before creating the url with the two answers...
try copying and pasting this...
Javascript:var lmnop=prompt('Search F.R. for ANY word(s):','');var ssize=prompt('and enter your shoe size:','');var urlpath='http://www.freerepublic.com/focus/news/search?m=any&o=time&s='+lmnop;{void(window.open(urlpath,lmnop))}
Navigation: use the links below to view more comments.
first 1-20, 21-23 next last
Disclaimer:
Opinions posted on Free Republic are those of the individual
posters and do not necessarily represent the opinion of Free Republic or its
management. All materials posted herein are protected by copyright law and the
exemption for fair use of copyrighted works.
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson