473,839 Members | 1,439 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to assign textbox value as php variables?

17 New Member
may i know if in php i can assign the textbox value from the user input as variables and then display the result of in the same page.

assume, user insert the checkin and checkout date, then it wil automatically show the numbers of the day the user will stay at the hotel.

any suggestion will really appreciates because i have no ideas what should i do ...

below is the code

Expand|Select|Wrap|Line Numbers
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5. <link rel="stylesheet" type="text/css" media="all" href="calendar-win2k-1.css" title="win2k-cold-1" />
  6. <script type="text/javascript" src="Kalendar/calendar.js"></script>
  7. <script type="text/javascript" src="Kalendar/calendar-en.js"></script>
  8. <script type="text/javascript" src="Kalendar/calendar-setup.js"></script>
  9. <script type="text/javascript" src="Kalendar/ew.js"></script>
  10. <script type="text/javascript"></script>
  11. <title>SistemAPOS</title>
  12. <style type="text/css">
  13. <!--
  14. .style7 {color: #FFFFFF}
  15. .style8 {
  16.     color: #000000;
  17.     font-weight: bold;
  18. }
  19. .style10 {color: #FFFFFF; font-weight: bold; }
  20. .style11 {font-weight: bold}
  21. -->
  22. </style>
  24. </head>
  26. <body>
  28. <form action="findroom.php" method="post">
  30.   <p>Check Room Availbility</p>
  31.   <p>Date In
  32.     <label>
  33.       <input type="text" name="datein" id="datein" />
  34.       <input name="datein" type="image" id="dateA" src="Kalendar/ew_calendar.gif" width="16" height="15" border="0" />
  35.   <script type="text/javascript">
  36.                     </script>
  37.             </strong>
  38.   <script type="text/javascript">Calendar.setup(
  39.                     {
  40.                         inputField : "datein", // ID of the input field
  41.                         ifFormat : "%Y-%m-%d", // the date format
  42.                         button : "dateA" // ID of the button
  43.                     }
  44.                     );
  45.                     document.write(ifFormat);
  46.                     </script>
  47.     </label>
  48.   </p>
  49.   <p>Date Out
  50.     <input type="text" name="dateout2" id="dateout" />
  51.     <input name="dateout" type="image" id="dateB" src="Kalendar/ew_calendar.gif" width="16" height="15" border="0" />
  52.     </strong>
  53.     <script type="text/javascript">Calendar.setup(
  54.                     {
  55.                         inputField : "dateout", // ID of the input field
  56.                         ifFormat : "%Y-%m-%d", // the date format
  57.                         button : "dateB" // ID of the button
  58.                     }
  59.                     );
  60.                     document.write(ifFormat);
  61.                     </script>
  62.   </p>
  63.   <p>Number of Days : Supposely this is the place where it will display how many days the user will stay</p>
  64.   <p>
  65.     <label>
  66.       <input type="submit" name="Check" id="Check" value="Submit" />
  67.     </label>
  68.   </p>
  69. </form>
  70. </body>
  71. </html>
Mar 18 '10 #1
2 6265
3 New Member
Is there any way you could explain what you want in more depth?
Mar 18 '10 #2
17 New Member
finally i know that i need to use javascript to solve this matter as i don't need to execute it at server
Mar 20 '10 #3

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

Similar topics

by: Eric | last post by:
How can I dynamically assign an event to an element? I have tried : (myelement is a text input) document.getElementById('myelement').onKeyUp = "myfnc(param1,param2,param3)"; document.getElementById('myelement') = new Function("myfnc(param1,param2,param3)");
by: dskillingstad | last post by:
I'm trying to assign a custom value to a textbox. Here's what I have. I've created a module and "default value" code for a textbox which generates a custom auto-number (yyyy-0000) when a New Record button is clicked. The code checks the table for the highest value and then assigns 1 and inserts the value. I have a second text box which needs the same type of custom auto-number which has to be generated from a second command button. ...
by: gjtired | last post by:
Currently I am retrieving values from a dataset and assigning the values to a textbox. I then assign the value from the textbox to a variable. I don't need the values in the textbox at all. I'm sure there is an easier way than I'm doing it. Any suggestions or help would be appreciated. Below is a snippet of code to show what I'm currently doing. string cmdQuestionEdit="SELECT Question_Subject, "+ "Question_Weight, "+ "QuestionType_ID,...
by: Grey | last post by:
I want to assign a value to HMTL textbox with id "txtABC" in ASP.NET with C#
by: Shilpi Chaudhry | last post by:
I have a forloop which I use to create textboxes - but unfortunately all of them have the same ids - I need to assign different ids to these textboxes creeated in the loop so that I can retrieve their corrs values. Anybody?? Code snippet: <% int y = 7; %>
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script language=""JavaScript"">" & vbCrLf strResponse = strResponse & "var aForm; " & vbCrLf
by: I am Sam | last post by:
I have a DataGrid that is passing information to a stored procedure properly but the parameters aren't being casted properly. I was woundering if anyone can tell me how I should properly cast the following: (TextBox)UserPrefix=(TextBox)e.Item.Cells.Controls; string strUserPrefix=UserPrefix.Text; I keep getting the following error and I don't know why because I have declared the UserPrefix as a textbox using "protected...
by: Swetha | last post by:
Hello I have a DropDownList that I am populating using the following SqlDataSource: <asp:DropDownList ID="parentIDDropDownList" runat="server" DataSourceID="SqlDataSource3" DataTextField="name" DataValueField="ID"></asp:DropDownList><asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
by: david | last post by:
I try to use "for" loop to retrieve and assign values in web form. The code is in the following. But it can not be compiled. What I want to do is: txtQ1.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q1") txtQ2.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q2") ..... txtQ10.Text = ds.Tables("mmsSpecRecord").Rows(0)("Q10") ------code ------- Dim field As String = "Q"
by: lianping | last post by:
Hi, I have a problem to assign a value into text box, below will be my script. Before view my script, let me hv quick explain on what is my problem: I would like to assign Java script value into VB text box, but i fail to do so. I can pass value with using: <form id="form1" runat="server">. however I' not able to do so, as i already use runat="server" at my MasterPage. Is that any others way i can assign value into the TextBox. Error...
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...

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.