Free Republic
Browse · Search
News/Activism
Topics · Post Article

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-2021-23 next last

1 posted on 10/10/2003 5:43:42 PM PDT by paul544
[ Post Reply | Private Reply | View Replies]

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)
[ Post Reply | Private Reply | To 1 | View Replies]

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
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!)
[ Post Reply | Private Reply | To 1 | View Replies]

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)
[ Post Reply | Private Reply | To 1 | View Replies]

To: GeronL
www.javascript.com
5 posted on 10/10/2003 5:48:49 PM PDT by GeronL (Please visit www.geocities.com/geronl)
[ Post Reply | Private Reply | To 4 | View Replies]

To: paul544
Here you go:

Use a select list to go to a new page

6 posted on 10/10/2003 5:49:21 PM PDT by SunStar (Democrats piss me off!)
[ Post Reply | Private Reply | To 1 | View Replies]

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)
[ Post Reply | Private Reply | To 1 | View Replies]

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!!!)
[ Post Reply | Private Reply | To 6 | View Replies]

To: paul544
Type site here:
9 posted on 10/10/2003 6:25:47 PM PDT by Tennessean4Bush
[ Post Reply | Private Reply | To 8 | View Replies]

To: Tennessean4Bush
??? Not following.
10 posted on 10/10/2003 6:32:23 PM PDT by paul544 (3D-Joy OH Boy!!!)
[ Post Reply | Private Reply | To 9 | View Replies]

To: paul544
I think what you are asking is pretty simple...

Here is something I created to search Free Republic.

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))}

11 posted on 10/10/2003 6:50:36 PM PDT by Future Useless Eater (Freedom_Loving_Engineer)
[ Post Reply | Private Reply | To 8 | View Replies]

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!!!)
[ Post Reply | Private Reply | To 11 | View Replies]

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>

13 posted on 10/10/2003 7:24:43 PM PDT by Tennessean4Bush
[ Post Reply | Private Reply | To 10 | View Replies]

To: Tennessean4Bush
Oops, line above should read:

if (lcSite.toUpperCase().indexOf("HTTP://")<0 && lcSite.toUpperCase().indexOf("HTTPS://")<0) {

14 posted on 10/10/2003 7:26:27 PM PDT by Tennessean4Bush
[ Post Reply | Private Reply | To 13 | View Replies]

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!

15 posted on 10/10/2003 7:28:35 PM PDT by Tennessean4Bush
[ Post Reply | Private Reply | To 10 | View Replies]

.
16 posted on 10/10/2003 7:34:03 PM PDT by StriperSniper
[ Post Reply | Private Reply | To 1 | View Replies]

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
[ Post Reply | Private Reply | To 1 | View Replies]

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!!!)
[ Post Reply | Private Reply | To 15 | View Replies]

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!!!)
[ Post Reply | Private Reply | To 17 | View Replies]

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))}

20 posted on 10/10/2003 7:50:25 PM PDT by Future Useless Eater (Freedom_Loving_Engineer)
[ Post Reply | Private Reply | To 12 | View Replies]


Navigation: use the links below to view more comments.
first 1-2021-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.

Free Republic
Browse · Search
News/Activism
Topics · Post Article

FreeRepublic, LLC, PO BOX 9771, FRESNO, CA 93794
FreeRepublic.com is powered by software copyright 2000-2008 John Robinson