JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today!
  #1  
Old April 19th, 2004, 09:34 PM
blippy blippy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 blippy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
JS Forms and input

I've had some experiance mostly with c+ and java, but since everything is going to towards the web and i'm not fond of java applett's, i thought i'd try some JS.

More specifically, one of my friends has a desktop (windows) that's a website. In it he had this google search, using a form on the desktop, you enter what you want, hit enter and you get the google results..it's nice.

I, being incredibly lazy, would like to create something like that, but have it work with ANY website entered. so URL (I don't konw why I'd go there, not a big fan of it) but would just simply open up my web browser and do it.

the google code is as follows. The important thing is that all of this is in a seperate file and the desktop html just references it.


form = '<form action="http://www.google.com/search" name="f" target="_new">';
form += ' <input type="hidden" name="hl" value="en">';
form += ' <input type="hidden" name="ie" value="ISO-8859-1">';

form += ' <font style="TITLE"><B>g o o g l e : : . .</B></font>';
form += ' <font size="-1">';
form += ' </font>';

form += ' <br>';
form += ' <input type="text" name="q" maxlength="128" size="45" value="" style="position:absolute; top: 18px;">';
form += '</form>';

document.write(form);

What i'm thinking is that I could create two forms. the first one, doesn't actually have that action part filled out, and the only important part is the '<input>' section. I would need to store that into inputVariable, create a new form and have action part equal to the inputVariable.

Any help, suggestions, n00b bashing and other such comments would be wonderful, thank you.

This is something along the lines of what I was thinking, but really have no idea. Thanks again.

var input="";
form = '<form action="" name="f">';

form += ' <font style="TITLE"><B>i n t e r n e t : : . .</B></font>';
form += ' <font size="-1">';
form += ' </font>';


form += ' <br>';
form += ' <input type="text" name="q" maxlength="128" size="45" value="" style="position:absolute; top: 18px;">';

input += form.q;

form += '</form>';

execForm = '<form action=input target="_new">';
execForm += '</form>';

document.write(form);


-blip




Reply With Quote
  #2  
Old April 19th, 2004, 09:57 PM
stumpy's Avatar
stumpy stumpy is offline
May contain nuts.
Dev Articles Regular (2000 - 2499 posts)
 
Join Date: Aug 2002
Location: Sydney, AU
Posts: 2,058 stumpy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 6 m 11 sec
Reputation Power: 8
Send a message via ICQ to stumpy Send a message via MSN to stumpy
I don't really understand what you're talking about?
Why are you creating a form entirely using JS?
To navigate to a site that the user enters in the url via a text box (why do this? I know I have my browser running the whole time my PC is on), use "document.location.href = document.formName.txtBox.value"
__________________
DevArticles Moderator
BlueSix - Web Development and Consulting

Reply With Quote
  #3  
Old April 19th, 2004, 10:56 PM
blippy blippy is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 2 blippy User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
well, the only reason i'm doing it entirely in JS is simply because i had a template becuase of the google search thing i posted above. and why would I want such a thing? it's faster then waiting for mozilla firefox (or IE for that matter) to open up and then type in where i go. but the main reason why is because i'm lazy.

thank you for your help. i'll check it out.

-blip

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingJavaScript Development > JS Forms and input


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 

Iron Speed




© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway