|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
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
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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" |
|
#3
|
|||
|
|||
|
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 |
![]() |
| Viewing: Dev Articles Community Forums > Programming > JavaScript Development > JS Forms and input |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|