PDA

Click to See Complete Forum and Search --> : i really don't understand, i NEED some HELP!!


sebs
Jan 29th, 2001, 02:09 PM
i went thru my code like 30 times, doiing all sort of test,
and i can't fing the bobo.

here is my code


...
strsql = "INSERT INTO tblPlayer (playerId,playerClubId,playerName,playerLastName,playerGroupID" _
& ") VALUES('" & newId & "',1,'" & request("firstname") &"', '"& request("lastname") & "',7)"
'set rs=conn.execute(strsql)
populateArrayCGM
%><Script language=javascript>
var nname;
var nn;
nn=document.info.infoNum.value;
nname=document.info.firstName.value + ', ' + document.info.lastName.value;
eval("opener.document.settime.Player" + nn + ".value='" + nname + "';");
eval("opener.document.settime.Id" + nn + ".value='<%=newId%>';");
window.close();
</Script>
<%
End if
%>


there is more before the ..., but it is not important for now!

everything after:
nn=document.info.infoNum.value;

does not execute,WHY
What is the problemo!!!

Ianpbaker
Jan 30th, 2001, 03:08 AM
Hi sebs

Two things

One - is your playerId column a string, as if it isn't, take away the single pip's for the values part.

two - are you trying to run this through PWS or IIS ?

as PWS doesn't allow you to embed asp inside script tags whereas IIS does

If it is neither of these, give us a shout and say where and what the error is

Ian

sebs
Jan 30th, 2001, 07:03 AM
no....

it only this that does not work:


%><Script language=javascript>
var nname;
var nn;
nn=document.info.infoNum.value;
nname=document.info.firstName.value + ', ' + document.info.lastName.value;
eval("opener.document.settime.Player" + nn + ".value='" + nname + "';");
eval("opener.document.settime.Id" + nn + ".value='<%=newId%>';");
window.close();
</Script>
<%


everything after
nn=document.info.infoNum.value;
does not work, my window does not close!if i put
an alert box before nn=document....
and one after, only the first one that will pop up!!

Ianpbaker
Jan 30th, 2001, 07:14 AM
Does it just do nothing or does it come up with an error message? As I can't see anything wrong with that aprt from the imbedded asp which I explained in my last post.


Ian

sebs
Jan 30th, 2001, 07:17 AM
nope, no error message,it look like my page reload though!

i have two text box and one of them clear after i hit the submit!

i really don't know what is wrong!!

tx for the help!!

Ianpbaker
Jan 30th, 2001, 07:23 AM
could you post your whole page please, as I have an idea but i need to c everything.

Ian

sebs
Jan 30th, 2001, 07:25 AM
here you go, i attach it to this thread!

just rename it to .asp

Ianpbaker
Jan 30th, 2001, 07:38 AM
Please correct me if i'm wrong

to me it looks like that top part of code (inside the if statement will never run. you open the page for first time and display's the field's, you then submit back onto itself and do the insert. From the code you gave me I you use sub as your value to check for and if I remember coreectly, the request.form will not pick up on that, try changing sub to <input type="hidden" value="Ok">, but still leaving the submit button there (get rid of the name and value part)

Give it a go

Ian

Ianpbaker
Jan 30th, 2001, 07:46 AM
i'm talking out of my back side. it does support the input submit. are you by chance viewing this in NS, If this is ina frameset it should work, but if your doing this with a new window then your trying to use the new window as modal and NS doesn't like modal at all.

sebs
Jan 30th, 2001, 07:49 AM
for the first part, yes it work, you can submit a form on itself,
i do it for other page in my project!

for the second part,i don't really understand what you are
saying!

no, i both tried it in MSIE and NN both does the same thing!

and yes i open it in a new window,that wht the
opener.document........

Ianpbaker
Jan 30th, 2001, 07:57 AM
sorry about that mate, I know you can submit back on itself, but i didn't know you could grab a value from a submit button, but I do know.

I think your problem is that you are trying to change value's of field's in a different browser window, and I haven't done anything like that before, so I can't help you with that one.

Sorry mate

Ian

sebs
Jan 30th, 2001, 08:04 AM
i almost have it, now it's only my window that does not
close.

i attach it if you wanna see what i did!!

sebs
Jan 30th, 2001, 08:24 AM
YEEESSSS!!!, now it work ,finally,

don't you hated it when it's a small problem that should
be easy but yet yoou spend like 3-4 hour on it!!

I love programming!!

It so fun when you find the problem!!