Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Who knows anything about HTML forms?

Who knows anything about HTML forms?
Thread Tools
neilnet
Dedicated MacNNer
Join Date: Oct 2000
Location: UK
Status: Offline
Reply With Quote
Aug 11, 2003, 09:10 AM
 
Quite a simple question I'm hoping...

I'm using Adobe GoLive to write a basic site (circa 35-40pgs). On the top of every page I've got a simple box/html form that's 35 characters long, with the intention being that a user need simply type in a search term into the box and off it goes to bring up the results.

To search at the moment I've got a seperate serarch page (/search.html) with a Java searching applet. To search using this you simply type in your search terms and hit enter - and it goes and does the rest - yadda yadda yadda.

Question - how do I set it such that when a user types a search term into the 35-character box (the one at the top of every page) and hits enter, the text that they typed is "copied and pasted" (if you get my drift) into the search.html page's Java applet?

All help *greatly* appreciated - because I know zip about HTML forms.

- Neil
I no longer have a signature.
     
Griggsy
Mac Enthusiast
Join Date: Jan 2001
Location: East of Belfast Furry Animal Sanctuary
Status: Offline
Reply With Quote
Aug 11, 2003, 09:47 AM
 
look at the way the java on the search.html 'packages' the search request, then you should be able to copy that into the form, you got examples?
Torn apart by the wood peckers of mistrust t0 not have this happen 2 u visit guinea pig::the life of a mac designer::
     
neilnet  (op)
Dedicated MacNNer
Join Date: Oct 2000
Location: UK
Status: Offline
Reply With Quote
Aug 11, 2003, 10:27 AM
 
Thanks for the help.

You'll find the main search page here.

It's kind of difficult to examine the source file - it appears to be an intact applet - but again - I know zip :-)

- Neil
I no longer have a signature.
     
derbs
Senior User
Join Date: May 2001
Location: Nottingham, UK
Status: Offline
Reply With Quote
Aug 11, 2003, 11:13 AM
 
Hmmm, not an easy one this.

Basically, you're going to have to send the search term as a querystring to search.html.

If you have your form code like this:

[form action="search.html" method="get"]
[input type="text" name="search"]
[/form]

Now if you type "whatever" into the search box and press return, the results page will come up in this format:

search.html?search=whatever

That's the easy bit, however. Now, you would have to grab the "whatever" bit out of the querystring using Javascript.

Then you would have to give this to the Applet with a [param] tag.

So, if you've got the applet like this:

[applet code="Search.class" width=400 height="300"]
[/applet]

You would need a couple of extra bits:

[applet code="Search.class" width=400 height="300"]
[param name="searchterm" value="whatever"]
[param name="dosearch" value="true"]
[/applet]

And then you'd have to add some code to the applet to see the param bits, and if the param "dosearch=true", then do the search automatically.

Could you post the code for the search java applet and i'll take a look.

edit: since when did this forum allow you to insert html???
     
neilnet  (op)
Dedicated MacNNer
Join Date: Oct 2000
Location: UK
Status: Offline
Reply With Quote
Aug 11, 2003, 11:58 AM
 
I'd love to post the code... but the applet is a freebie doodah in which I can't view the source. For obvious reasons the main file (which is a .class) opened in TextEdit appears in its raw form :-(

You can download the "app" here It's only a few kb in size.

If you could find a way around it I'd be jolly appreciative

Thanks -

Neil
( Last edited by neilnet; Aug 11, 2003 at 12:06 PM. )
I no longer have a signature.
     
Arkham_c
Mac Elite
Join Date: Dec 2001
Location: Atlanta, GA, USA
Status: Offline
Reply With Quote
Aug 11, 2003, 10:57 PM
 
Originally posted by neilnet:
I'd love to post the code... but the applet is a freebie doodah in which I can't view the source. For obvious reasons the main file (which is a .class) opened in TextEdit appears in its raw form :-(

You can download the "app" here It's only a few kb in size.

If you could find a way around it I'd be jolly appreciative

Thanks -

Neil
There are tools to "decompile" java back into source. Just look around for one.
Mac Pro 2x 2.66 GHz Dual core, Apple TV 160GB, two Windows XP PCs
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 03:52 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,