Jump to content

display listbox selected item on another webpage


davidcook

Recommended Posts

hello, i need to display the listbox selected item on a different webpage(for paypal-google checkout transaction). how would i do that?

 

<div id="selection_wrapper" style="margin-top: px;">

        <div id="states">

      <?php render_states_list(); ?>

</div>

        <div id="npa">

        <div id="npas_wrapper">

                <ul class="list_box"></ul>

        </div>

        </div>

<div id="dids">

        <div id="dids_wrapper">

                <ul class="list_box"></ul>

        </div></div>

        </div>

        <br style="clear:both;" />

<div id="selected"><span id="selected_number_display">Selected number: none</span>

        </div>

 

thank you in advance.

dave

thank you for the reply,

i am using a listbox to select a telephone number from a mysql database and a telephoe carrier api which contains states, area codes and telephone numbers.

after the customer is finished selecting the number, it is display on the webpage. however, i need to display the selected telephone number on another webpage to complete the transaction with paypal or google checkout. currently, all this goes on one webpage, but i need to change the format of this whole process. here is what i have for the transaction to be completed on one page:

<div id="selection_wrapper" style="margin-top: px;">

<div id="states">

 

<?php render_states_list(); ?>

</div>

 

<div id="npa">

           

 

            <div id="npas_wrapper">

                <ul class="list_box"></ul>

                </div>

            </div>

<div id="dids">

           

<div id="dids_wrapper">

                <ul class="list_box"></ul>

                </div></div>

</div>

 

<br style="clear:both;" />

 

<div id="selected"><span id="selected_number_display">Selected number: none</span></div>

 

          <!-- End selection -->

 

then the payment plans, paypal and google checkout transactions begin. i want to break this process up onto two webpages.

thank you in advance.

dave

So you mean a multi-page form? That's very straight-forward.

 

Basically, how it works is you use a form on each page.:

page1.php

 

<form method="post" action="page2.php">
First Name:<input type="text" name="first_name" />
Last Name:<input type="text" name="last_name"  />
<input type="submit" name="submit" />
</form>

Then in page 2, you echo the variables from page 1 into hidden fields in the form for use on page 3:

page2.php

 

<?php
$fname=htmlspecialchars($_POST['first_name']);
$lname=htmlspecialchars($_POST['last_name']);
?>
<html>
<head></head>
<body>
<form method="post" action="page3.php">
<input type="hidden" name="first_name" value="<?php echo $fname;?>" />
<input type="hidden" name="last_name" value="<?php echo $lname;?>" />
Education:<input type="text" name="education" />
School:<input type="text" name="school" />
<input type="submit" name="submit" />
</form>
</body>
</html>

The same goes for page 3:

page3.php

<?php
$fname=htmlspecialchars($_POST['first_name']);
$lname=htmlspecialchars($_POST['last_name']);
$education=htmlspecialchars($_POST['education']);
$school=htmlspecialchars($_POST['school']);
?>
<html>
<head></head>
<body>
<form method="post" action="page4.php">
<input type="hidden" name="first_name" value="<?php echo $fname;?>" />
<input type="hidden" name="last_name" value="<?php echo $lname;?>" />
<input type="hidden" name="education" value="<?php echo $education;?>" />
<input type="hidden" name="school" value="<?php echo $school;?>" />
Experience:<input type="text" name="experience" />
<input type="submit" name="submit" />
</form>
</body>
</html>

Now, all the variables from all 3 pages are posted to page 4.

Hope this helps

 

 

- Copied, then modified, from daniweb.com by user buddylee17

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.