473,513 Members | 2,425 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Generating a post/input form on the same page during a button onClick event?

2 New Member
I need an ajax/js function that will generate an input form to be filled up when the Add Traveler button is clicked. (not open a new window but generate it on the same page)

Expand|Select|Wrap|Line Numbers
  1. <td> Travelers:</td>
  2. <td><input type="button" onClick="" name="" value="Add Traveler" /></td>
  3.  
So, I want to generate this form when the button is clicked:

Expand|Select|Wrap|Line Numbers
  1. <?php
  2. <form name="addto_names" action="" method="POST">
  3.   <table>
  4.     <tr><td> Travel Order No. :</td></tr>
  5.             <td><input type="text" name="to_no" value=""></td>
  6.         <tr><td> Employee Id :</td></tr>
  7.             <td><input type="text" name="empid" value=""></td>
  8.         <tr><td> Employee or Student :</td></tr>
  9.             <td><select name="nametype">
  10.                 <option>Employee</option>
  11.                 <option>Student</option>
  12.                 </select>
  13.             </td>
  14.         <tr><td > Traveler Name :</td></tr>
  15.             <td><input type="text" name="to_name" value=""></td>
  16.         <td><input type="hidden" name="lastuser" value="<?php echo              $_SESSION['username']; ?>"
  17.    </table>
  18. </form>
  19. ?>
Dec 8 '11 #1
3 1391
Dormilich
8,658 Recognized Expert Moderator Expert
yes, load the HTML chunk via AJAX and insert it in your HTML.
Dec 8 '11 #2
bendajao
2 New Member
Yeah. Can you help me with it? Thanks.
Dec 8 '11 #3
Dormilich
8,658 Recognized Expert Moderator Expert
what does your AJAX code look like?
Dec 8 '11 #4

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

Similar topics

4
39444
by: Dipin | last post by:
Hi All; I have this javascript which is adding a new button to the column in the row which is created dynamically, the innerhtml shows that the onclick event is correctly added but it never gets...
4
35167
by: Daisy | last post by:
In my user control: <asp:Button id="btnLogin" runat="server" Text="Login"></asp:Button> And the code-behind: protected override void OnInit(EventArgs e) { btnLogin.EnableViewState = true;...
4
3064
by: Chad | last post by:
I have a link (.ascx) and that generates an Add form on that page. The autopostback dropdown is within a "If Not IsPostBack Then" statement. The form that is created is all via static html in the...
2
1616
by: Roger Cantillo | last post by:
Hi, In a webform, is it possible to change the OnClick event of a button at runtime? -- Axiom Software, Ltd. 400 Columbus Ave Valhalla, NY 10595 (914) 769-8800
11
11227
by: cindy | last post by:
I have a form, has javascript registered so a modal pops up. Button click will close form. Now I need to do an update with modal form data before it closes. I can put a second button and register...
2
2060
by: moondaddy | last post by:
I have an asp.net 2.0 application and put a html button on a web page. I double clicked on the button and it crated the event handler for me and created the stub js function for it like this: ...
4
1933
by: hon123456 | last post by:
Dear all, Suppose I have a form as follows: <script> functionABC() { alert("Hello world")} </script> <form name="form1" action="test.php" method="post">
1
3958
by: CoolRajan | last post by:
Hi friends, I have four form pages in my application and all the pages contain different fields for entering values in that. In my first page I have one Continue button and on submitting it...
7
7252
by: chronic malfeasance | last post by:
Hello, I have a C# .Net 2.0 project. Every single page with a button that contains an OnClick method receives a Compilation Error on run stating the definition for the OnClick method does not...
1
2519
by: munkee | last post by:
A very simple question which I cant answer myself at the meoment due to epic tiredness. I have a combobox in my access 2003 database which is populated with the real names of users taken from a...
0
7264
marktang
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,...
0
7166
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
7386
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
7543
jinu1996
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...
1
7106
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
7534
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
4749
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...
0
3236
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...
0
3226
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.