473,414 Members | 1,590 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Viewing Hidden Fields from Form1 to Form2?

9
hi

I have set hiddens fields in form1 and now i am trying to view the hiddens fields in form2....I did

if(isset($_POST['confirm'])){......

echo "$name";

But the problem is ...It only show one row..it does not show all the rows for e.g.

name
----------
tom[tom]
jerry[jerry]

[tom]<<hidden field

when i echo $name it only shows tom....the name column is in while loop...
Apr 28 '07 #1
6 2728
pbmods
5,821 Expert 4TB
If the other input is in a different form, then it won't be submitted when the User submits the first form. To get the value of the other hidden input, you'd need to include it in the same form as the first input on the page.
Apr 28 '07 #2
mmc
9
i am trying to echo "room_Type_break" field, the problem is it only prints twice of each room_Type. for e.g.

cal.php

room_type
--------
ensuite
ensuite
single
single

book.php : Output:

single single

it is not printing out ensuite...any idea?


cal.php
[php]
if($qty !== '0'){
$p=0;
while($fday<$tday){
echo "<td>$room_Type<input type='text' name='room_Type_break' value='$room_Type'></td>
$p++;

}echo "<input type='hidden' name='count' value='$p'>"; }

[/php]
book.php
[php]
for ($i = 0; $i <= $_POST['count']; $i++) {

$room_Type_break = $_REQUEST['room_Type_break_'.$i.''];

echo "$room_Type_break";
}[/php]
Apr 28 '07 #3
pbmods
5,821 Expert 4TB
Try changing the name of the input from "room_Type_break" to "room_Type_break[]". That way, PHP will save all the entries in a field with that name to an array.

http://www.php.net/manual/en/languag...s.external.php
Apr 28 '07 #4
mmc
9
i am confused...can u show me how using the code i posted previous
Apr 28 '07 #5
pbmods
5,821 Expert 4TB
i am confused...can u show me how using the code i posted previous

[php]
if($qty !== '0'){

$p=0;

while($fday<$tday){

echo "<td>$room_Type<input type='text' name='room_Type_break' value='$room_Type'></td>

$p++;



} echo "<input type='hidden' name='count' value='$p'>"; }
[/php]

[php]
if($qty !== '0') {
$p=0;

while($fday < $tday) { // -----------------------------------¬
echo "<td>$room_Type<input type='text' name='room_Type_break[]' value='$room_Type'></td>
$p++;
}

echo "<input type='hidden' name='count' value='$p'>";
}

[/php]

Note the name of the input above. When you go to process your input after the User submits the form, you would reference $_REQUEST['room_Type_break'][0], $_REQUEST['room_Type_break'][1], etc.
Apr 28 '07 #6
mmc
9
thanks...i used foreach loop to extract the data
Apr 30 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Geir Holme | last post by:
Hi all. We do have a little anoying problem with forms and FormBorderStyle.Maximized. We opens Form1 with FormBorderstyle = FixedDialog. We hides it and opens Form2 with FormBorderStyle =...
1
by: Roy Adams | last post by:
Hi Group I'm trying to write from dynamically created hidden fields to a txt field in the onchange event handler within a select. basically the number for the for loop is generated by a field...
0
by: sshuangw | last post by:
Hello: I am encountering a very weird issue with MDI child, Overriden WndProc function and hidden form. Basically, the application has two forms, Form1(parent form), Form2(Child form),...
17
by: Jim Burns | last post by:
How do I Get a ref to my hidden Object like a Form1 When I try to Show the Form1 from Form2 I can not get a reference to the same instance. I can Show New Form1's but I cant unhide The one I Hid...
1
by: Richard | last post by:
Hello there, I have a form that is called from a Sub Main procedure using application.run(Form1). On my main form there is a button to open an instance of Form2 and then at the same time hide...
6
by: ahmad.humyn | last post by:
I want to call a hidden form. My code goes something like in which the main calls form1. form1 has a button which creates & calls form2 and hides itself. Now I have a button in form2 which if...
8
by: pt36 | last post by:
I have two pages one.html two.html page one.html have a form named form1 and a textarea named text1 man one write in the textarea text 1 page two.html have a form named form2 and a...
2
by: ooroboo | last post by:
i have only made programs with 1 form or control before as i am new to vb. i have added a hide button to my to my form(form1) (me.hide) i wont form2 (form2) to load when my form1 gets hidden...
4
by: =?Utf-8?B?Z2luYWNyZXNzZQ==?= | last post by:
I am trying to close/dispose multiple instances of a form but because they are modal and hidden, they do not show up in My.Application.OpenForms. They must be modal, so making them modeless is not...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.