473,387 Members | 1,789 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,387 software developers and data experts.

Checkbox problem

Dear All,

Please assist me for below code :
What i need is -> One "Patient Master" form for online Entry :
My AIM -> When somebody want to add new patient a parent form will open

than finally he typed patient id " jakap " and press tab button than a
new pop window will
open and finally displays all name / id starts with " ja " when user
will click on any of patient using checkbox corresponding to his name
and id then all pop up form values like his name, last name , id and
dob will be autocomplete in parent form this already i've achieved but
i am facing problem when single record will be there in popup window at
that moment parent form is not filled by popup values because length is
coming undefined :
My function is accepting field parameter which checkbox name (pt_id)
and popup window
will generate list of input named first_name1,last_name2, dob1, pt_id
and if rows are more than one series will keep on move.

Javascript code as follows :

function transfer_values(field)
{
var len = new Array(field.length);
for (i = 0; i < field.length; i++)
{
var topic_id = new Array(field.length);
for (i = 0; i < field.length; i++)
if (field[i].checked == true)
{
//alert(field[i].id + field[i].value)
topic_id[i]=(field[i].id);
len[i]=(field[i].value);
//alert ("This is params value :" + (topic_id[i]));
//alert(topic_id[i]);
//alert("This is len :"+len[i]);
///////////////////////////
self.opener.document.forms[0].elements['x_insurance1'].value =
self.document.forms[0].elements['ins_id'+len[i]].value
//self.opener.document.forms[0].elements['x_last_name'].value =
self.document.forms[0].elements['last_name'+len[i]].value
//self.opener.document.forms[0].elements['x_first_name'].value =
self.document.forms[0].elements['first_name'+len[i]].value
//self.opener.document.forms[0].elements['x_dob'].value =
self.document.forms[0].elements['dob'+len[i]].value
//self.opener.document.forms[0].elements['x_deductible'].focus();
self.window.close()

}
}
}

Jan 4 '06 #1
2 1789
When there is just one element checked in checkbox group then you can
check directly for its value..
Something like this..
if( ! (field.length)) {
alert(field.value);
}

--Sunil P/

Jan 5 '06 #2
Thanks Sunil for help i'll try it now...

Jan 5 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Claire | last post by:
Hello, I am having a problem in my struts application with the checkboxes in my form. I have an array of checkboxes, some of which may be already selected when the form loads. My problem is when...
2
by: Tomas Vera | last post by:
Hello All, I'm having problems creating a page with dynamic checkboxes in a WebApp. In my app, I need to query a database, then (based on results) add checkboxes to my form and set their...
0
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
10
by: Jennyfer J Barco | last post by:
Hello, I have a datagrid that brings some information from a query. I need to have a checkbox in each row so the user can select the rows he wants to reprint. Is it possible to have a checkbox...
4
by: SJ | last post by:
Hi all, I have come across a weird problem when attempting to automatically set the focus in a vb.net form to a checkbox control... In my form I have (on a tab page in a tab control) several...
1
by: spolsky | last post by:
try the the following code with Opera 9.01 (Windows). when clicked slightly faster than normal clicking, the toggler checkbox and other checkboxes displays differently although event method works...
9
by: morellik | last post by:
Dear all, I have a program that creates dinamically a web page. In the page I have the following function to check how many checkbox are checked. function tarInfo(info) { var i=0; var c=0;...
0
by: cyberdawg999 | last post by:
Greetings all in ASP land I have overcome one obstacle that took me 2 weeks to overcome and I did it!!!!! I am so elated!! thank you to all who invested their time and energy towards helping me...
3
by: Mahathi | last post by:
Hi I have a small problem in maintaining the state of a check box. Please do me a favour by telling me the procedure how to do that. My requirement is that "I have to map some roles with...
4
by: Charlotte | last post by:
Hi, I have a problem with a ASP-script, can somewone help me ? here is what I've got: mypage.asp : .... code ... <%
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.