|
The reason Table 1 get duplicated is because you placed table 1 fields in detail.
You can add a group by Table 1, then place the table 1 fields in that group header.
You should have a relationship between the 2 tables too, I suspect if table 1 has more than 1 row, the result will still be duplicated still.
|
|
|
|
|
I'm starting to hate posting questions like this on these forums but my hands are so tied on this subject my fingers are turning blue.
Here's the problem, my company runs a old (but still functional) cms system writting entirely in classic asp with 95% vbscript now there are a few pages that have drop down boxes that should have parent / child data relationships
if the user selects an option from box A then box b is cleared and filled from the database based on the ID of the selected item of box A. ok that's cake got that working fine now here's where my head starts hurting.
I've been told that i have to get it working without posting back to the server....
the site itself is one monster include (the seven levels of hell seem like a good vacation spot compared to this site) now in the pages that this funtion is needed there are multiple input boxes and checkboxes and other fun stuff that's generation is burried in multiple include files of which NONE of them have their viewstate property set. so even if i wanted to post back and load box B i'd loose all the information on the page. and i can't just strip and rewrite this part of the cms cause it's just to complicated for one person to do on their own plus this was supposed to be a "quick" fix.
so i wrote 2 client side scripts in vbscript the first clears any existing option elemenets from the second select element it then calls the second that opens a database and runs a stored procedure the when passed the ID from the selecteditem of the first select element it spits out the applicable child records. works great only two huge problems.
1. if internet security is not set to allow database connections from another domain then it will crash and keep popping up a message (i got it to work on my test computer but i can't obviously set every users internet security settings)
2. My connection string with EVERYTHING including password is there in plain text for all to see
if anyone has any ideas how to get around this i would greatly appreciate the help.
here's the script part of the page for reference
<script language="vbscript" type="text/vbscript">
Sub GetCategory()
ConStr = "Driver={SQL Server};Server=x.x.x.x;Database=db;Uid=uid;Pwd=pwd"
Set Conn = CreateObject("ADODB.Connection")
Conn.open ConStr
Rs = CreateObject("ADODB.RecordSet")
Set Rs = Conn.Execute("EXEC dbo.SelectCategoryByClassID @ClassID = " & Document.All.sClass(Document.All.sClass.SelectedIndex).Value)
do while not rs.eof
Set oOption = Document.CreateElement("OPTION")
oOption.Text = rs("CategoryTitle")
oOption.Value = rs("CategoryTitle")
Document.All.sCategory.Add( oOption )
Rs.movenext
loop
Set oOption = Nothing
Rs.Close
Set Rs = Nothing
CreateObject
End Sub
Sub changeCats()
Do Until Document.All.sCategory.Length = 1
Document.All.sCategory.Remove( 1 )
Loop
Call GetCategory()
End Sub
</script>
Ryan
|
|
|
|
|
Ryan, try using AJAX/XMLHttpRequest.
AJAX uses javascript which allows you to send data back to the web server and receive resulting data (all as text) without postback of the page.
Obviously you need to have the user authenticated/logged on the website, therefore you can have the web page itself handle all the database connection required without you needing to send username and password or connecting to a database from the client side.
There are several javascript libraries such as Sarissa[^] which will make your life easier working with AJAX.
I do not know of any ASP-specific AJAX library, but there are plenty .Net AJAX libraries out there.
If you need examples or more information, check the AJAX[^] section of CodeProject.
Hope that helps, good luck
Edbert
Sydney, Australia
"A day without sunshine is like, you know, night."
-- modified at 18:51 Tuesday 7th February, 2006
|
|
|
|
|
If it's not much data you need, you can just put all the data you need in an array in javascript, and populate the drop down box from the array.
---
b { font-weight: normal; }
|
|
|
|
|
How can I get my form buttons to be a certain minimum width, and grow wider if necessary?
In IE this is easy, apply the style width: 70px; . IE handles this incorrectly and will automatically grow the button as needed.
In FF this doesn't work, because it correctly truncates the button text.
In FF I believe the correct style to use would be min-width : 70px; , but this causes my button label to be left aligned, and applying text-align : center; has no effect.
Any ideas?
"Time sneaks up on you like a windshield on a bug." - John Lithgow
|
|
|
|
|
In case anyone was wondering, this min-width issue appears to be a bug[^] in Gecko.
"Time sneaks up on you like a windshield on a bug." - John Lithgow
-- modified at 13:02 Wednesday 8th February, 2006
|
|
|
|
|
Are there any (ideally free) tools around that can generate image maps from images? E.g., something that will generate the coords attribute for the area tags from clicking on the relevant points of a shape(s). My shapes would be regions of a City.
Kevin
|
|
|
|
|
i am not understanding ur problem fully. i am suggesting that this link will be helpful for u http://answers.google.com/answers/threadview?id=595699
VMSSanthosh
|
|
|
|
|
Hi all,
I have 2 java Web services and i make reference to those WS from .Net client.
The 2 web services shares common data object (for example object called UIObject)
From .net environment it refer to UIObject as 2 diffrent objects. one belongs to the first WS and the other to the second one and he doesn't recognize it as the same object.
does anyone know how can i solve it?
Thanks,
Liran
|
|
|
|
|
Hi!
How do you specify a connectionstring in the "ButtonClick" event?
Illegal Operation
Making Computer Software Talk
|
|
|
|
|
How do you open a soup can in a red house?
The connectionstring has nothing with the ButtonClick event to do, so you have to explain what you mean by the question.
---
b { font-weight: normal; }
|
|
|
|
|
Good Day All,
i want to get the name of my system using client side scripting such as javascript. e.g if the name of my machine is mysystem then the same name would be obtained using javascripting on my browser.
Best regards
Bilal
|
|
|
|
|
i'm very new to java scripts and this one is giving me a hard time. i simply want to add an integer to this variable to use it afterward but it seems whatever i do, the addition isnt done and the variable stays unchanged... here's part of the code :
xs = oPart.selectSingleNode("X").text;
x = (xs + 100)
there i put 100, but i've tried with integer variables too without success. it seems that x will always equal xs no matter what i do! i've tried to put "parseint" and it gives me a "Expected object" error. there must be some kind of synthax problem or something, but i've already spent hours on this tiny newbie problem, trying everything i could imagine. that's why i ask for some help here.
any hint would be very appreciated! thanks
|
|
|
|
|
Javascript is case sensitive.
x = parseInt(xs) + 100;
---
b { font-weight: normal; }
|
|
|
|
|
i want to get a value from a JScript variable:
in JS
function GetID()
{
var Valu = "123";
return (Valu);
}
<font color="blue">in the HTML</font>
<form action="somepage" method="post" name="xForm">
<input type="hidden" <font color="RED">value="GetID();"</font> name="ID">
<font color="blue">the problem in the red text, the GetID function doesn't return a value, the only value return to the <font color="RED">value</font> is the name of the function...so is there some mistake in my code????? </font>
</strong>
Militiaware
Faris Madi
|
|
|
|
|
Yes, there is a mistake. You can only use javascript in event properties in html, like onclick, onmouseover, et.c.
---
b { font-weight: normal; }
|
|
|
|
|
Guffa is right i think. Maybe you can do something like this:
<form action="somepage" method="post" name="xForm">
<script language="JavaScript" type="text/javascript">
document.write("<input type=\"hidden\" value=\"" + GetID() + "\" name=\"ID\">");
</script>
"..Commit yourself to quality from day one..it's better to do nothing at all than to do something badly.."
-- Mark McCormick || Fold With Us! || Pensieve || VG.Net ||
|
|
|
|
|
okay:
my question is how to get a value from a textbox and send it with the post.
in this case:
i have two forms
form one contains the textbox
form two contains the submit
when i click on the submit i want to send with the post of the form two the values in form one? how?
Militiaware
Faris Madi
|
|
|
|
|
Why do you write your post in bold? Bold text is used to emphasize words in a text, if you emphasize the entire text, it's just annoying. Almost like SCREAMING.
Why do you have two forms in the first place?
Put hidden fields in the second form, and copy the values from the first form into the hidden fields.
---
b { font-weight: normal; }
|
|
|
|
|
i've 2 day in programming web application.....
how can i copy the values from the form1 to the form2
<form1><input type=hidden name=H1 value=111 ...etc <---------
<form2><imput type=hidden name=H1 ...etc <---------
in other words the value if H1 = 111???
Militiaware
Faris Madi
-- modified at 5:57 Tuesday 7th February, 2006
|
|
|
|
|
Why do you have two forms in the first place?
To copy the values you use javascript code like this:
document.form2.H1.value = document.form1.H1.value;
---
b { font-weight: normal; }
|
|
|
|
|
What "REFRESH" do to the web page. Does "REFRESH" download the page again? by call it again or there's another story behind it?
Militiaware
Faris Madi
|
|
|
|
|
Please remove the marquee effect if you want to be taken seriously!
ColinMackay.net
"Man who stand on hill with mouth open will wait long time for roast duck to drop in." -- Confucius
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
|
|
|
|
|
The refresh button in most browsers will load the page from the cache if appropriate (hasn't expired, no query string, etc.), but there is usually a means of forcing everything (page, images, etc.) to be downloaded again (Ctrl+F5 in IE and FF). window.location.reload(true); will also accomplish this sort of cache flushing.
|
|
|
|
|
I read so many....... articles about ajax. It looks that the writers know what they are talking about.
BUT what is the simple way to update db with some data I got from my form.
And please don't refer me to an article where someone created a monstrous library that can sumbit a rocket to the moon...
|
|
|
|