You are not logged in.

#1 2004-08-23 12:13:07

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Javascript Question (dynamic links)

Hello, there.  I suck at JavaScript and haven't grasped it yet...Here's my question:

I have a form with a textbox called "text_qty", a select called "select_color" and a submit button called "button_submit".  I want to, onclick of the submit button, make it forward to a URL comprised of the values in the select and the textbox, like so:

http://www.mydomain.com/car.php?qty=[text_qty]&color=[select_color]

How could I do this?  Or is there a good, newbie-oriented website that deals with this type of JavaScript issue?

ANy help would be greatly appreciated.  Thanks.  smile

Offline

#2 2004-08-23 13:09:39

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Javascript Question (dynamic links)

beniro wrote:

I want to, onclick of the submit button, make it forward to a URL comprised of the values in the select and the textbox, like so:

http://www.mydomain.com/car.php?qty=[text_qty]&color=[select_color]

I guess you are looking for method="get" instead of method="post" in the form element? Post sends form values in http header (not visible in browser) and get sends it as url.

beniro wrote:

How could I do this?  Or is there a good, newbie-oriented website that deals with this type of JavaScript issue?

You are kidding right ? :-)
http://www.google.com/search?hl=en&ie=U … method+get

Offline

#3 2004-08-23 13:20:54

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: Javascript Question (dynamic links)

No, I was not kidding.  smile

Thanks for the "get" tip, though.  I'm a newbie.

*hangs head in shame*  smile

Offline

#4 2004-08-23 14:02:59

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: Javascript Question (dynamic links)

I got it working.  Oddly enough, my HTML knowledge is apparently still wanting, because I realize now that I could do all this with only the "get" method, as you posted.  Very easy.  Duh!

Thanks again!  smile

Offline

#5 2004-08-23 15:39:28

oscar
Member
From: Kiruna, Sweden
Registered: 2004-08-13
Posts: 457

Re: Javascript Question (dynamic links)

beniro wrote:

I got it working.  Oddly enough, my HTML knowledge is apparently still wanting, because I realize now that I could do all this with only the "get" method, as you posted.  Very easy.  Duh!

Thanks again!  smile

I will give you this piece of advice -
make sure you learn xhtml and css, before you start fooling around with javascript or things like it.
when you know xhtml and css, you can have some look at php and databases, and after that... ^_^
(I'm still in learning xhtml and css, and have begun looking at php)
javascript isn't that very usefuly, except for some minor functions...


To err is human... to really foul up requires the root password.

Offline

#6 2004-08-24 15:36:55

beniro
Member
From: St. Petersburg, FL, USA
Registered: 2002-12-31
Posts: 313

Re: Javascript Question (dynamic links)

Well, I guess I actually know more than I let on...I currently work creating DB-driven sites using MS-SQL and ASP.  I know XHTML and CSS fairly completely, but never took the time to figure out what the difference was between "get" and "post".

As for JavaScript...it's necessary, IMHO.  What would you do the client-side stuff with if not in JavaScript???  But I'm just starting on it.

AND, I'd like to learn more PostgreSQL and Python/PHP to be a bit freer, but oh, well.  smile

Offline

#7 2004-08-24 21:07:42

lanrat
Member
From: Poland
Registered: 2003-10-28
Posts: 1,274

Re: Javascript Question (dynamic links)

beniro wrote:

Well, I guess I actually know more than I let on...I currently work creating DB-driven sites using MS-SQL and ASP.

That's more or less what I'm doing in my primary work (and some other projects too) :-)

Offline

Board footer

Powered by FluxBB