Prev: Detecting if an array element is undefined or null
Next: FAQ- How can I access the client-side filesystem? * THIS FAQ'SRATHER *PITIFUL*
From: Richard Cornford on 12 Mar 2010 06:01 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.
From: David Mark on 12 Mar 2010 06:12 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
From: Evertjan. on 13 Mar 2010 10:18 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'> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
From: Richard Cornford on 14 Mar 2010 22:39 Evertjan wrote: > 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'> 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.
From: Evertjan. on 15 Mar 2010 11:24
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> -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress) |