The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> help please - post to form, post fields to a form
wheaty
post Dec 23 2014, 06:32 AM
Post #1





Group: Members
Posts: 1
Joined: 23-December 14
Member No.: 21,961



Good morning

Would someone be able to guide me with some coding tips?

I'm trying to post some current page info into a form on the next page.
Either pass the page url, the page title, or the H3 tags through the "Enquire" & "Book now" buttons from the below php file.

The fields on the form will then be hidden from view but passed through the submit button.

I need help passing the info in this code below:


<!--<div class="fright">-->
<p class="packagebuttons">
<a class="button print" href="#" onclick="window.print();">Print</a>
<!-- <a class="button thickbox" href="#TB_inline?height=500&amp;width=700&amp;inlineId=modalEnquire_<?php echo $node->nid; ?>&amp;modal=true">Enquire</a>
<a class="button thickbox book" href="#TB_inline?height=500&amp;width=700&amp;inlineId=modalEnquire_<?php echo $node->nid; ?>_book&amp;modal=true">Book</a> -->
<a class="button" href="#goto_form">Enquire</a>
<a class="button book" href="#goto_form">Book</a>
</p>
<?php ukgirl_modal_enquire($node,'package'); ?>
<?php ukgirl_modal_enquire($node,'package','book'); ?>
<!--</div>-->
<div class="clear"></div>

Many thanks for anyones help this close to Christmas!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post Dec 23 2014, 06:51 AM
Post #2


.
********

Group: WDG Moderators
Posts: 9,656
Joined: 10-August 06
Member No.: 7



QUOTE(wheaty @ Dec 23 2014, 12:32 PM) *

I'm trying to post some current page info into a form on the next page.

That might be done e.g. with hidden INPUT form fields. Seems you could create both the form fields and their values when the page is created.

QUOTE
Either pass the page url, the page title, or the H3 tags through the "Enquire" & "Book now" buttons from the below php file.

Those buttons are just links (that run javascript?). Do you want to populate hidden form fields only when these links are clicked (and not before that)?

QUOTE
I need help passing the info in this code below:

Half of that HTML is commented out, and it doesn't contain any form elements. unsure.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Aizen
post Dec 26 2014, 04:37 AM
Post #3


Newbie
*

Group: Members
Posts: 13
Joined: 15-December 14
Member No.: 21,939



If you're asking how to create a form, then it should be like so..

<form action="next page url here" name="form_one" method="post">

<input type="text" name="textbox" placeholder="Enter some text here">
<input type="submit" name="submitbtn">

</form>

And you simply retrieve the values in the page you've entered in "action".
isset is used to check if a value has been entered, and if so store it in $userinput.

if (isset($userinput = $_POST['textbox']){
$userinput = $_POST['textbox'];
}

You can create text box by setting "type" to text, and the same can be done to create hidden fields. something like <input type="hidden" value="true">
hidden fields can be used to validate if the user has submitted the form, or w.e you need it to do.

This post has been edited by Aizen: Dec 26 2014, 04:38 AM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 25th April 2024 - 01:41 AM