|
|
||||||
|
||||||
| Index Link To US Private Messages Archive FAQ RSS | ||||||
| Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome. |
Share Thread: & Tags
|
||||
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Not exactly sure how to read that.... do you need help in extracting the data from a form from a previous page or?
|
|
|||
|
Hi,
If you're using some kind of server side scripting language you could simply pass the id of the required bouquet as part of the query string for the link (eg index.php?bid=1). Thats assuming each bouquet has a unique id. On the next page you can pick up this id and decide which radio button to select based on it. Mike |
|
||||
|
No the other way around: Clicking the order form link from a product page and the link/script somehow containing the information to populate the form (in this case, checking the appropriate radio button.
So for example if you were looking at the 'lilies' page and you decide you want to buy some lilies, you click the 'order Lilies' button which takes you through to the order form with the 'Lilies bouquet' radio button checked, so all you have to do is fill in your details. There are a lot of programs online for extracting data from forms, but I am looking for the reverse. Does that make sense? Sorry. Thanx Mike your reply came through just as I was sending this. Do you have an example script to pick up the ID on form page? |
|
|||
|
What language would you be using? i know my way around php and asp, assuming the link index.asp?bid=1 in asp you can use
Response.Write Request.QueryString("bid") In PHP it would be echo $_GET['bid']; Both will output the value of bid to the screen. |
|
||||
|
I don't know the PHP way, Debbie. But in ASP, I can at least give you the concept that I use.
Basically, I gather up all of the form data sent to me via post (no querystrings, since if you I hidden fields, the user can alter the data post facto). So here's how it works in ASP (the simple coding): Code:
<%
Dim Some_Field
Some_Field = Request.Form ("Some_Field")
...
%>
<input type="text" name="Some_Field" value="<% = Some_Field %>" />
The second time around, whatever you put in the Some_Field field will appear in the field. Personally, I prefer to gather form elements to variables since that way, I can populate a form with either values retrieved from a database or form posts or even querystrings on rare occasions, depending on how I choose to set it up.
__________________
Toronto Web Design | Search Engine Friendly, Standards-Compliant Layouts | Walk on my Path (my blog) |
|
||||
|
Is there a way to accomplish this using Javascript?
On my travels into Cyberspace, I have come across http://www.webreference.com/programm...t/jf/column11/ Which is almost the same thing but with the previous page instead of the pop-up window. Any help will br gratefully received. Thanx. |
|
|||
|
Here is how it would basically work in PHP:
Code:
<?php
if (isset($_POST['flowers'])) {
$flower_type = $_POST['flowers'];
echo "Your customer wants to buy $flower_type";
} else {
echo "
<form name='flower_type' method='post' action='$PHP_SELF'>
<label>
<input type='radio' name='flowers' value='Lillies'>Lillies</label>
<label>
<input type='radio' name='flowers' value='Daffodils'>Daffodils</label>
</p>
</form>";
}
?>
__________________
Silver Spring Real Estate | Southern Maryland Real Estate | Military Relocation Specialist |
|
|||
|
NP, glad I could answer instead of ask for once. Anyway:
Code:
<?php
echo "
<form name='flower_type' method='post' action='review.php'>
<label>
<input type='radio' name='flowers' value='Lillies'>Lillies</label>
<label>
<input type='radio' name='flowers' value='Daffodils'>Daffodils</label>
</p>
</form>";
?>
<?php
if (isset($_POST['flowers'])) {
$flower_type = $_POST['flowers'];
echo "Your customer wants to buy $flower_type";
} else {
echo "You must choose a flower type, please go back."
}
?>
__________________
Silver Spring Real Estate | Southern Maryland Real Estate | Military Relocation Specialist |
![]() |
|
| Thread Tools | |
| Display Modes | |
|
|
|
WebProWorld |
Advertise |
Contact Us |
About |
Forum Rules |
MVP's |
Archive |
Newsletter Archive |
Top |
WebProNews
WebProWorld is an iEntry, Inc. ® site - © 2009 All Rights Reserved Privacy Policy and Legal iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509 |