Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-25-2012, 02:08 PM   PM User | #1
markswan20
New to the CF scene

 
Join Date: Jun 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
markswan20 is an unknown quantity at this point
Prepopulate Form From A URL

I have found various answers on the internet but none of them seem to work

When i follow a URL to my form page i need a field to have the product already filled out. no matter what i tried it never populates the field.

I have tried the following

http://www.yourcaketopper.co.uk/cont....php?name=mark

The form name is called contactform
The ID field is called name

Is there anything special i need to do to make it work or is it not possible.

Your help is very much appreciated in advance.

Thank You Very Much
Mark
markswan20 is offline   Reply With Quote
Old 06-25-2012, 03:08 PM   PM User | #2
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Is there anything special i need to do to make it work or is it not possible.
Where's your code ? The following should work.
PHP Code:
<input type="text" name="somename" value="<?php echo $_GET['name']?>">
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 06-25-2012, 05:16 PM   PM User | #3
markswan20
New to the CF scene

 
Join Date: Jun 2012
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
markswan20 is an unknown quantity at this point
I'm really sorry for me being pretty vague, where do i put your response?

My scenario is i have 4 options when a customer clicks on a picture it will put the picture id in the required box on the form, this isn't the actual form yet i want to use the hyperlink that way it saves me setting hundreds of paypal buttons i can use just 1 using a different ref number.

I am truly sorry if i am being awkward i'm just newish to this

I truely appreciate your help

Mark
markswan20 is offline   Reply With Quote
Old 06-25-2012, 06:20 PM   PM User | #4
jdswebservice
Regular Coder

 
jdswebservice's Avatar
 
Join Date: Aug 2010
Location: Moon Township, PA
Posts: 107
Thanks: 0
Thanked 5 Times in 5 Posts
jdswebservice can only hope to improve
Resolved

You'll probably want to do an OnClick on the image and use javascript to generate putting the value into the form input tag.

code is below.

Code:
<html>
<head>
	<title>
		Post ID: 266216
	</title>
	<script type="text/javascript">
	function changeValue(value) {
		document.getElementById('myField').value=value;
	}
	</script>
</head>
<body>


<img src="" width="100" height="100" onclick="changeValue('value1')">
<br>
<br>
<img src="" width="100" height="100" onclick="changeValue('value2')">
<br>
<br>
<img src="" width="100" height="100" onclick="changeValue('value3')">
<br>
<br>
<img src="" width="100" height="100" onclick="changeValue('value4')">
<br>
<br>
<input type="text" name="myField" id="myField">
<br>
<br>
<input type="submit" value="****s and Giggles Submit Button">


</body>
</html>
Copy and paste that into a new HTML file and you'll have what you want!

Happy Coding!
jdswebservice is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 03:39 AM.


Advertisement
Log in to turn off these ads.