Author | Topic: multipart/form-data -- strange behavior | |
---|---|---|
Steve Woolstenhulme | multipart/form-data -- strange behavior on Sat, 11 Jul 2009 21:58:32 -0500 I have an application that uploads files. For the form I use: <form action="/cgi-bin/waa1gate.isa" method="post" enctype="multipart/form-data"> Recently I needed to add a variable to store in a table to let me know whether the file was to be visible to all visitors, or just to selected authorized and logged-in users. So I put in a radio button with a name/id of "V" (for visibility): <input type="radio" name="V" id="V" value="Y"> Logged-in users only <input type="radio" name="V" id="V" value="N" checked> Anyone Alas, when I tried to retrieve the value [ oHtml:getVar( 'V' ) ] in my SAVE function , no joy! The variable was empty. I tried a checkbox instead of a radio. Same thing. I tried an [ input type="text" ] and set an input box where I could type in Y or N. STILL didn't work! After a day of trying dozens of different combinations, I tried this: <input type="radio" name="V" id="V" value="YYY"> Logged-in users only <input type="radio" name="V" id="V" value="NNN" checked> Anyone It worked! I experimented and found that SINGLE CHARACTER VALUES don't seem to get sent. I used oHtml:GetAllVars() and walked the arrays looking at values. If the value was more than one character it showed up in the SAVE function. If it was only one character, the value was empty. I'd appreciate it if someone can tell me whether I've overlooked something, or whether maybe someone needs to look into multipart/form-data. I have lots of other radio buttons in forms without the [ enctype="multipart/form-data" ] and they work just fine with one character. | |
Steve Woolstenhulme | Re: multipart/form-data -- strange behavior on Mon, 10 Aug 2009 14:36:18 -0500 Thanks for the Hotfix, Andreas. It fixed the problem. "Steve Woolstenhulme" <swoolstenhulme at gmail.com> wrote in message news:48eed5f6$3f27411f$11a25@news.alaska-software.com... >I have an application that uploads files. For the form I use: > > <form action="/cgi-bin/waa1gate.isa" method="post" > enctype="multipart/form-data"> > > Recently I needed to add a variable to store in a table to let me know > whether the file was to be visible to all visitors, or just to selected > authorized and logged-in users. So I put in a radio button with a name/id > of "V" (for visibility): > > <input type="radio" name="V" id="V" value="Y"> Logged-in users only > <input type="radio" name="V" id="V" value="N" checked> Anyone > > Alas, when I tried to retrieve the value [ oHtml:getVar( 'V' ) ] in my > SAVE function , no joy! The variable was empty. > > I tried a checkbox instead of a radio. Same thing. I tried an [ input > type="text" ] and set an input box where I could type in Y or N. STILL > didn't work! > > After a day of trying dozens of different combinations, I tried this: > > <input type="radio" name="V" id="V" value="YYY"> Logged-in users only > <input type="radio" name="V" id="V" value="NNN" checked> Anyone > > It worked! I experimented and found that SINGLE CHARACTER VALUES don't > seem to get sent. I used oHtml:GetAllVars() and walked the arrays looking > at values. If the value was more than one character it showed up in the > SAVE function. If it was only one character, the value was empty. > > I'd appreciate it if someone can tell me whether I've overlooked > something, or whether maybe someone needs to look into > multipart/form-data. I have lots of other radio buttons in forms without > the [ enctype="multipart/form-data" ] and they work just fine with one > character. > > > |