Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Nee Kat

Ranch Hand
+ Follow
since Jan 27, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Nee Kat

I have to create a join of two tables with the following fields:
User_x
Full_Name
Login_Name
Group_List

Group_x
Group_name
Groupid

In User_x table grouplist comprises of list of groups a user belongs to separated by a semi colon. e.g. 12;78;65

Now I need to create a join where I get a list of all the users with the group they belong to.
The result set should look like this
User Groupname
Tom Group1
Peter Group2
Kathy Group2


and so on...
Actual SQL wil be appreciated.
16 years ago
I have to create a form in which depending on selection from Field 1 the type of Filed 2 will be selected between a dropdown and a text filed.
e.g Field 1 is a dropdown box and it has values a,b,c,d. If we select 'a' in filed 1 then filed 2 should be dropdown otherwise it should be a text box for all the remaining values. Code samples would be appreciated.

Thanks
-Nee
I have been able to create a dropdown box but still looking for a way to populate it. Please help me.

Regards,
nee
I have to add rows to a table dynamically .i.e. by using JavaScript. I was able to add row using the follwoing code I found over the net. The problem is I have to create a dropdown in couple of cells in the new added row and add certain predefined values in it using cfquery.
But with this code I was not able add that as this adds a text box. Any changes in this code to add the drop down would be helpful.

function addRowToTable()
{
var tbl = document.getElementById('tblSample');
var lastRow = tbl.rows.length;
// if there's no header row in the table, then iteration = lastRow + 1
var iteration = lastRow;
var row = tbl.insertRow(lastRow);

// left cell
var cellLeft = row.insertCell(0);
var textNode = document.createTextNode(iteration);
cellLeft.appendChild(textNode);

// right cell
var cellRight = row.insertCell(1);
var el = document.createElement('input');
el.setAttribute('type', 'text');
el.setAttribute('name', 'txtRow' + iteration);
el.setAttribute('id', 'txtRow' + iteration);
el.setAttribute('size', '40');
el.onekeypress = keyPressTest;
cellRight.appendChild(el);
}

I am unable to post the HTML as it is not allowed to post certain functions in JS ( I got this in the error)



Thanks!
Thanks for the code Chris. It works great.
I have to create a dropdown box based on a selection in another drop down on the same page.

I mean to say if a dropdown A has a selection "1" then only dropdown B should show otherwise not.
Disabling B would also work and enable it only when dropdown A has a selection "1".

Any ideas how to do this..like which functions should be used. Code would be appreciated.
Anuja,

I also have the same question. PLease let me know if you get solution to this. Please post it here. Code would be helpful.

Thanks!
I am confused.
If the document is stored on C:\home\code\menu.xml so can I access it using this code or not from a template which is stored on the same drive?

var xmldoc = new ActiveXObject("Microsoft.XMLDOM");
xmldoc.async = false;
xmldoc.load("C:\home\code\menu.xml")



Regards,
Neekat
What about an XML document. Can I access data from an XML document using JS. The data is not that much so I can use an XML document. If yes, how to access using JS.
What is the best way to access/query data using javascript. I have to query an Oracle database.
Any sample code will be appreciated.

Regards,
Neekat
Eric,

I didn't understand your suggestion as I am new to JS

Here is the code which is generating the check boxes

<input type="checkbox" name="menus" id="#boxID#" value="#current_menuid#" <cfif ListFind(user_menu,current_menuid) NEQ 0>checked</cfif>

and what I tried was to catch the input box by getting the value of boxid and hardcoding it in the function.

For example the value of 1 check box id is "menus_1" so I tried this but this is not working:

function trial(){
alert("hello");
document.menus_1_1.checked == true;
}

It doesn't has any form name because the check box is not in any form.
Any suggestions?
I have a page where all the input types check boxes are dynamically generated using loops.
i.e.they are not hard coded.

I have to create an onclick event in which if I select one option then certain check boxes should be selected.
As the check boxes are not hardcoded so I am having a problem finding the unique identifier.

How should I get around this?
I changed it but it doesn't helps.
Actually, it is a cfform and cfselect is being used to call this function.

Here is the code:

<cfform action="#formtarget#" id="httpform" name ="httpform">

some code here......

<cfselect name="PROTOCOL" onchange="setPort();">
<option <cfif PROTOCOL is "HTTP">selected</cfif> value="HTTP">HTTP</option>
<option <cfif PROTOCOL is "HTTPS">selected</cfif> value="HTTPS">HTTPS</option>
</cfselect>

</cfform>

What will be the syntax here?

Thanks!
I have written javascript function to change the port from 80 to 443 in case of secure connection i. e https://

In Internet Explorer, when setting up an HTTP monitor and chosing the protocol of HTTPS, the port changes from 80 to 443. But this javascript does not work in Firefox.

Here is the function:

function setPort() {
var protocolelement = document.getElementById("PROTOCOL");
var portelement = document.getElementById("PORT");

if (portelement.value == "80" || portelement.value == "443") {
if (protocolelement.value == "HTTP") {
portelement.value = "80";
} else if (protocolelement.value == "HTTPS") {
portelement.value = "443";
}
}
}

Could it be a DOM compatibility issue?

Thanks.