473,473 Members | 2,144 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

submit form in JavaScript

1 New Member
hi someone please help me. i have problem to submit the form that required to pass the parameter. the parameter is form the split data in the next page. Th coding is like below :

Expand|Select|Wrap|Line Numbers
  1. output = "<table border='0' width='100%' cellpadding='0' cellspacing='0' style='padding:5px 5px 5px 5px;font-family:arial;font-size:12px;text-align:center;'>\
  2.                         <tr>\
  3.                             <th width='5%'>#</th>\
  4.                             <th width='15%'>Name</th>\
  5.                             <th width='15%'>Leave Type</th>\
  6.                             <th width='6%'>Current Balance</th>\
  7.                             <th width='6%'>Pending Leave</th>\
  8.                             <th width='6%'>Bal. Leave Can Apply</th>\
  9.                             <th width='6%'>Bal. After Force Leave</th>\
  10.                             <th width='15%'>Action</th>\
  11.                         </tr>\
  12.             ";
  13.  
  14.             for(i=0;i<row.length-1;i++)
  15.             {
  16.                 col = row[i].split("<->");
  17.  
  18.                 var staffName = col[0],leave_type=col[1],current_balance=col[2],pending_leave=col[3],balance_apply=col[4], balance_after_force=col[5], actionLeave=col[6];
  19.  
  20.                 output += "<tr>\
  21.                             <td>"+(i+1)+"</td>\
  22.                             <td>"+staffName+"</td>\
  23.                             <td>"+leave_type+"</td>\
  24.                             <td>"+current_balance+"</td>\
  25.                             <td>"+pending_leave+"</td>\
  26.                             <td>"+balance_apply+"</td>\
  27.                             <td>"+balance_after_force+"</td>\
  28.                             <td>"+actionLeave+"</td>\
  29.                             <!--td id='testing'><input type='text' value='"+staffName+"' id='staffname'></td-->\
  30.                         </tr>\
  31.                         ";    
  32.             }
  33.             output += "</table><br><app_button onclick='submitForce("+staffName+")'>Submit</app_button>";                            
  34.              $("#leave_record").html(output);
  35.         }
  36.     });
  37.  
  38. }
  39.  
  40. function submitForce(staffName)
  41. {
  42.     alert("masuk");
  43. }
Mar 13 '12 #1
1 1273
Dormilich
8,658 Recognized Expert Moderator Expert
I don’t see where <-> should split a row. besides that, if you pass a string parameter, you would have to pass the quotes separately (that’s why inline JavaScript is so disadvantageous).
Mar 13 '12 #2

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

Similar topics

2
by: vishal | last post by:
hello friends i have one php script which generates html page containing form. what i want is submit this form using php script. pls give me some idea that how can i submit form using php...
2
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the...
4
by: Slug | last post by:
Hello, I've tried to find this answer, but can't seem to get a clear example - I'm using the following classic asp code to submit a form: <form action="default.asp" name=order method=post> ...
2
by: Terence Parker | last post by:
How does one go about submitting a form with a link - but submitting it to a new window AND to a page different to that described within the action="" option of the <form> tag? Say, for example,...
1
by: Matt | last post by:
The problem is I have 3 buttons that need to submit the form to different URL. My approach is to declare <input type="submit"> rather than <input type="button">. And put the following in the...
6
by: tencip | last post by:
Hi everyone, So, i've got a form that is very simple. It hold three elements: username, password, and domain. The goal here is to have the form submit the login to an administrative section...
1
by: Andy Kasotia | last post by:
I have an ASP UI with VB Dll as a COM object that access the DB2 Database. I have a "Calculate" button on the ASP Page which when clicked does form validation (javascript) and submits the form...
4
by: Matthew256 | last post by:
How can I submit this form on criteriaBlur? <form> <input type="text" name="criteria1" onblur="criteriaBlur(this);"> </form> function criteriaBlur( obj ) { if( ... ) { //submit form }
1
by: MZ | last post by:
Hello! Is it possible to change URL form action on submit form... I have tried such code: <script language="JavaScript" type="text/javascript"> function changeURL() {
1
by: arggg | last post by:
I created a submit form that calls a javascript:AjAX Command that will call the data and submit it without have the page refresh. This works perfect in Firefox however in IE and Opera when the...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
1
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
agi2029
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,...
1
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...
0
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
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.