Reply
Putting something from a form on the end of a link
Old 04-10-2008, 05:12 AM Putting something from a form on the end of a link
Average Talker

Posts: 21
Location: Huddersfield, UK
Hi,

Not sure if this should like here or in JavaScript or whatever (depends on the answers I get I suppose!) but I hope someone can suggest something.

I have a link that looks like this:

http://www...com/basket.html?screen=...931:quantity=1

You see that quantity=1 at the end? I want to be able to have a link that doesn't have the '1' but can pick up a number entered into a text box.

I'm sure there's a way of doing this but I don't know how. Do you?

One stumbling block is that it's a website with online admin. I don't have general access to the FTP server and I don't know what kind of server it's running on so no ASP or PHP can be used. I'm hoping there's an HTML or javascript answer to this.

Cheers for reading, hope you can help.

Scott.
tuestunim is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 04-10-2008, 05:22 AM Re: Putting something from a form on the end of a link
chrishirst's Avatar
Super Moderator

Posts: 13,671
Location: Blackpool. UK
POST the form to put the form values into a querystring
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-10-2008, 05:48 AM Re: Putting something from a form on the end of a link
Average Talker

Posts: 21
Location: Huddersfield, UK
Cheers for your help Chris but I'm not quite there yet.

I've got this:

<form method="post" action="http://www...com/basket.html?screen=basket&action=update&basket:559 e250cb34d33c4bfc678796b519931:quantity=">
<input name="m07qty" type="text" />
<input type="submit" />
</form>

But all it's doing is going to the address in the "action" area. I need it to take the inputted number from the m07qty text box and add it to the address in "action".

Any ideas?

Scott.
tuestunim is offline
Reply With Quote
View Public Profile
 
Old 04-10-2008, 06:38 PM Re: Putting something from a form on the end of a link
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
try this? I might not have understood though.

Code:
<form method="post" action="http://www...com/basket.html">
<input type="hidden" name="screen" value="basket">
<input type="hidden" name="action" value="update">
<input type="hidden" name="basket" value="559 e250cb34d33c4bfc678796b519931">
<input type="hidden" name="quantity" value="">   
<input name="m07qty" type="text" />
  <input type="submit" />
</form>
if thats not what u mean, maybe this is.

Code:
<form method="GET" action="http://www...com/basket.html?screen=basket&action=update&basket:559 e250cb34d33c4bfc678796b519931:quantity=">
  <input name="m07qty" type="text" />
  <input type="submit" />
</form>
EDIT: I think its the second one, if you want the m07qty to appear in the URL then use that.
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 04:07 AM Re: Putting something from a form on the end of a link
Average Talker

Posts: 21
Location: Huddersfield, UK
Hi Gilligan, thanks for your help.

Unfortunately for some reason when I submit the form it's omitting everything after the ?. This is happening with both things you suggested.

I'll keep on trying though as I'm sure there's a way of doing it.

Scott.
tuestunim is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 10:18 AM Re: Putting something from a form on the end of a link
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
Can you clear this up for me??

You want everything after the ? to be displayed in the URL, including the m07qty?

if so. this should do it

Code:
<form method="get" action="http://www...com/basket.html">
<input type="hidden" name="screen" value="basket">
<input type="hidden" name="action" value="update">
<input type="hidden" name="basket" value="559e250cb34d33c4bfc678796b519931">
<input type="hidden" name="quantity" value="">   
<input name="m07qty" type="text" />
  <input type="submit" />
</form>
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 10:27 AM Re: Putting something from a form on the end of a link
Average Talker

Posts: 21
Location: Huddersfield, UK
The link I want at the end of it all is as follows:

http://www...com/
basket.html?
screen=basket
&action=update
&basket:559e250cb34d33c4bfc678796b519931:quantity= 1

As you can see, there's no ampersand before the quantity so I don't think it's as simple as entering a number into a form. I'm starting to wonder if it can be done at all. I've had another play about with it myself earlier today and didn't get anywhere.

Thanks for persevering though!

Scott.

P.S. At the end of it all I want that long string of characters after 'basket' to be selected with a drop down menu, as they represent individual products (or sizes or products) on the site, but I just can't see this happening!
tuestunim is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 10:45 AM Re: Putting something from a form on the end of a link
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
I just read back on your first post and think I understand what you mean now.

In order for it to work there needs to be a & in front of quantity. But we'll just replace ':' with '&' ?

Code:
<form method="get" action="http://www...com/basket.html">
<input type="hidden" name="screen" value="basket">
<input type="hidden" name="action" value="update">
<input type="hidden" name="basket" value="559e250cb34d33c4bfc678796b519931">
<input name="quantity" type="text" />
  <input type="submit" />
</form>
Try that maybe?
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 04-11-2008, 10:54 AM Re: Putting something from a form on the end of a link
Average Talker

Posts: 21
Location: Huddersfield, UK
It doesn't work that way, unfortunately. As I said in the first post I've not got access to change anything so I can't get around that. It needs to be a :, not a &. The link I was hoping to build through the use of a form has to exactly resemble the link posted in my last message.

The code you've put there I tried earlier on this morning myself. Great minds and all that...!

Thanks a lot for your help but it doesn't look as if I'm gonna get what I need.

Oh well!

Again, thanks for trying both of you. If you come up with any genius ideas I'll be more than happy to hear them

Scott.
tuestunim is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Putting something from a form on the end of a link
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.14863 seconds with 12 queries