Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

PASSING VALUES BETWEEN SCRIPTS

0 views
Skip to first unread message

Rob Christiansen

unread,
Mar 11, 2010, 12:09:00 PM3/11/10
to
<input type="radio" name= "RecnumToModify" ACCESSKEY= "<%
Response.Write( rs("id").Value ) %>" >
</TD>

</TR>

</TABLE>

<FORM ACTION= "http://ccs2468.com/santa/stagrecnum.asp" METHOD= POST >
<input type=submit name= BUTTON value= Tag >
</form>
<%
}

ON SUBMIT, SCRIPT PASSES TO http://ccs2468.com/santa/stagrecnum.asp BUT
HOW DO I PASS THE VALUE OF RecnumToModify?

<%@ Language=JavaScript %>
<%

Response.Write( "RecnumToModify= "+ RecnumToModify+"<br>" );
%>

[
Microsoft JScript runtime error '800a1391'
'RecnumToModify' is undefined
/santa/stagrecnum.asp, line 23
]

*** Sent via Developersdex http://www.developersdex.com ***

Richard Cornford

unread,
Mar 11, 2010, 12:19:58 PM3/11/10
to
On Mar 11, 5:09 pm, Rob Christiansen wrote:
> <input type="radio" name= "RecnumToModify" ACCESSKEY= "<%
> Response.Write( rs("id").Value ) %>" >
> </TD>
>
> </TR>
>
> </TABLE>
>
> <FORM ACTION= "http://ccs2468.com/santa/stagrecnum.asp"
> METHOD= POST >
> <input type=submit name= BUTTON value= Tag >
> </form>
> <%
> }
>
> ON SUBMIT, SCRIPT PASSES TOhttp://ccs2468.com/santa/stagrecnum.aspBUT
> HOW DO I PASS THE VALUE OF RecnumToModify?
<snip>

Your RecnumToModify radio button does not have a VALUE attribute, but
instead has a rather elaborate ACCESSKEY attribute. While there is no
value there is no potential for passing it.

Richard.

Asen Bozhilov

unread,
Mar 11, 2010, 2:52:32 PM3/11/10
to

At all Rob's markup is broken. He should move input element with name
attribute "RecnumToModify" as child of form element.

Rob Christiansen

unread,
Mar 11, 2010, 5:51:40 PM3/11/10
to
OK I changed back. I had tried something I saw in a book
-----------------
<input type="radio" name= "RecnumToModify" value= "<%

Response.Write( rs("id").Value ) %>" >
</TD>

</TR>

</TABLE>


<FORM ACTION= "http://ccs2468.com/santa/stagrecnum.asp" METHOD= POST >

<input type=submit name= submit value= Tag >
</form>
<%
}

ON SUBMIT, SCRIPT PASSES TO http://ccs2468.com/santa/stagrecnum.asp BUT
HOW DO I PASS THE VALUE OF RecnumToModify?

<%@ Language=JavaScript %>
<%

Response.Write( "RecnumToModify= "+ recnumtomodify+"<br>" );

Evertjan.

unread,
Mar 12, 2010, 3:39:29 AM3/12/10
to
Rob Christiansen wrote on 11 mrt 2010 in comp.lang.javascript:

> OK I changed back. I had tried something I saw in a book
> -----------------
> <input type="radio" name= "RecnumToModify" value= "<%
> Response.Write( rs("id").Value ) %>" >
> </TD>
>
> </TR>
>
> </TABLE>
>
>
> <FORM ACTION= "http://ccs2468.com/santa/stagrecnum.asp" METHOD= POST >
> <input type=submit name= submit value= Tag >
> </form>

Never do that, older IE will mangle the name/valie of a submit, use a
hidden valure.

> <%
>}
>
> ON SUBMIT, SCRIPT PASSES TO http://ccs2468.com/santa/stagrecnum.asp BUT
> HOW DO I PASS THE VALUE OF RecnumToModify?

var recnumtomodify = Request.form("RecnumToModify");

> <%@ Language=JavaScript %>
> <%
>
> Response.Write( "RecnumToModify= "+ recnumtomodify+"<br>" );
> %>
>
> [
> Microsoft JScript runtime error '800a1391'
> 'RecnumToModify' is undefined
> /santa/stagrecnum.asp, line 23
> ]

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)

Richard Cornford

unread,
Mar 12, 2010, 6:01:03 AM3/12/10
to
On Mar 12, 8:39 am, Evertjan. wrote:
> Rob Christiansen wrote on 11 mrt 2010 in comp.lang.javascript:
>> OK I changed back. I had tried something I saw in a book
>> -----------------
>> <input type="radio" name= "RecnumToModify" value= "<%
>> Response.Write( rs("id").Value ) %>" >

Depending on the possible range of values here, there should probably
be some 'escaping' for attribute value context.

>> </TD>
>
>> </TR>
>
>> </TABLE>
>
>> <FORM ACTION= "http://ccs2468.com/santa/stagrecnum.asp" METHOD=POST >
>> <input type=submit name= submit value= Tag >
>> </form>
>
> Never do that, older IE will mangle the name/valie of a submit, use
> a hidden valure.

Do you mean (by "that") name the INPUT element "submit"? That will
make the form's - submit - method inaccessible, but on many more
browsers than just IE (older or otherwise), but is only really
significant if the intention is then to attempt to use the form's -
submit - method (even if it does represent a bad habit that is best
avoided in general).

>> <%
>>}
>
>> ON SUBMIT, SCRIPT PASSES TOhttp://ccs2468.com/santa/stagrecnum.aspBUT
>> HOW DO I PASS THE VALUE OF RecnumToModify?
>
> var recnumtomodify = Request.form("RecnumToModify");
>
>> <%@ Language=JavaScript %>
>> <%
>
>> Response.Write( "RecnumToModify= "+ recnumtomodify+"<br>" );
>> %>

As Asen Bozhilov pointed out yesterday, if the INPUT filed is not
contained within the FORM element then it is not part of the form and
its VALUE (now that it has one) will not be submitted with the form.

Richard.

David Mark

unread,
Mar 12, 2010, 6:12:36 AM3/12/10
to
Richard Cornford wrote:
> On Mar 12, 8:39 am, Evertjan. wrote:
>> Rob Christiansen wrote on 11 mrt 2010 in comp.lang.javascript:
>>> OK I changed back. I had tried something I saw in a book
>>> -----------------
>>> <input type="radio" name= "RecnumToModify" value= "<%
>>> Response.Write( rs("id").Value ) %>" >
>
> Depending on the possible range of values here, there should probably
> be some 'escaping' for attribute value context.

Yes. Would be particularly bad if the value contains a double quote. :)

The method is Server.HTMLEncode:-

http://msdn.microsoft.com/en-us/library/ms525347.aspx

Evertjan.

unread,
Mar 13, 2010, 10:18:43 AM3/13/10
to
Richard Cornford wrote on 12 mrt 2010 in comp.lang.javascript:

> On Mar 12, 8:39�am, Evertjan. wrote:
>> Rob Christiansen wrote on 11 mrt 2010 in comp.lang.javascript:

>>> <input type=submit name= submit value= Tag >
>>

>> Never do that, older IE will mangle the name/valie of a submit, use
>> a hidden valure.
>
> Do you mean (by "that") name the INPUT element "submit"? That will
> make the form's - submit - method inaccessible, but on many more
> browsers than just IE (older or otherwise), but is only really
> significant if the intention is then to attempt to use the form's -
> submit - method (even if it does represent a bad habit that is best
> avoided in general).

Yes and no, I mean do not try to send the value of the submit button, as
some older browsers seem to make a mess of that. Since it is near
impossible to test for all versions of all browsers:

Not:

<input type='submit' name='mySubmit' value='this one'>

but

<input type='hidden' name='mySubmit' value='this one'>
<input type='submit' value='this one'>

Richard Cornford

unread,
Mar 14, 2010, 10:39:48 PM3/14/10
to

I have never seen an issue with <input type="submit"> that would justify
this assertion. Are you confusing this with <button type="submit">,
which certainly is inconsistent across browsers (particularly with
regard to the values submitted)?

Richard.

Evertjan.

unread,
Mar 15, 2010, 11:24:53 AM3/15/10
to
Richard Cornford wrote on 15 mrt 2010 in comp.lang.javascript:

>> <input type='hidden' name='mySubmit' value='this one'>
>> <input type='submit' value='this one'>
>
> I have never seen an issue with <input type="submit"> that would justify
> this assertion. Are you confusing this with <button type="submit">,
> which certainly is inconsistent across browsers (particularly with
> regard to the values submitted)?

You could very well be right,
perhaps even with a "untyped" <button>

0 new messages