Replace checkbox by hidden field

liunx

Guest
I would like the replace a checkbox with a hidden field. I have tried with:<br />
<br />
<input type=hidden name="searchintitle" value="true"><br />
<br />
This seems not to work. To what value does the variable have to be set to activate or inactivate it (checked, selected, 1 etc.)?<br />
<br />
Thanks,<br />
<br />
Hanno<!--content-->I would use 1.<!--content-->I tried 1, true, selected, checked but non of them give the result I expect.<br />
Any other ideas?<br />
<br />
Hanno<!--content-->let see the form code and what script are you using to parse the results from the form? and waht did you expect?<!--content-->The form is:<br />
<br />
<br />
<FORM ACTION="http://www.xcalak.info/cgi-bin/kforum.cgi" METHOD=GET><br />
<TABLE ALIGN=CENTER BGCOLOR=#f3efe0 width=95%><br />
<tr> <br />
<td ALIGN=RIGHT colspan=2 BGCOLOR="#333366"> <FONT SIZE=-1> <A HREF=http://www.htmlforums.com/archive/index.php/"http://www.xcalak.info/cgi-bin/kforum.cgi?viewmode=xcalak&action=listwithsub&object=topic">Forum <br />
List</A> <A HREF=http://www.htmlforums.com/archive/index.php/"http://www.xcalak.info/cgi-bin/kforum.cgi?viewmode=xcalak&object=user&action=create">Register</A> <br />
<A HREF=http://www.htmlforums.com/archive/index.php/"http://www.xcalak.info/cgi-bin/kforum.cgi?viewmode=xcalak&object=user&action=login">Login</A> <br />
<A HREF=http://www.htmlforums.com/archive/index.php/"http://www.xcalak.info/cgi-bin/kforum.cgi?viewmode=xcalak&object=user&action=edit">User <br />
Profile</A> </FONT> </td><br />
</tr><br />
<tr><br />
<th colspan=2 BGCOLOR="#336666">Forum search</th><br />
</tr><br />
<tr><br />
<td BGCOLOR="#333366">String to search for:</td><br />
<td BGCOLOR="#333366"><br />
<INPUT NAME="searchstring"><br />
</td><br />
</tr><br />
<tr><br />
<td BGCOLOR="#333366">Search in:</td><br />
<td BGCOLOR="#333366"><br />
<select name="searchforumid"><br />
<option value="all">All forums<br />
<option value="0,0">General - General<br />
<option value="1,0">Business - General<br />
<option value="3,0">Visiting Xcalak - General<br />
<option value="4,0">Living in Xcalak - General<br />
</select><br />
</td><br />
</tr><br />
<br />
</TABLE><br />
<input type=hidden name="action" value="list"><input type=hidden name="enumorder" value="normal"><input type=hidden name="maxentries" value="25"><input type=hidden name="object" value="searchresult"><input type=hidden name="viewmode" value="xcalak"><br />
<br />
<input type=hidden name="searchintitle" value="1"><br />
<br />
<input type=hidden name="searchincontent" value="1"><br />
<br />
<input type=hidden name="searchinusername" value="1"><br />
<br><br />
<CENTER><INPUT TYPE="SUBMIT" VALUE="Submit"></CENTER><br />
</FORM><br />
<br />
The problem is that I can't read the cgi script. So I can't check the code for the required reslut. I expected the checkbox always to give the same values returned.<br />
<br />
Hanno<!--content-->ok what was the names of the checkbox? and if you can't read the cgi then that means it is not on your server so you don't have an idea what it is looking for. it still should do the same thing. if you checkbox was named "searchintitle" and then you made a hidden field with the same name then it should work. if the check box is not checked it returns a "0" if it was checked it returns a 1, so it all depends on what the cgi script is looking for.<br />
<br />
also you are using the get statment and the cgi file might be getting it from there and hidden fields don't get moved in the url I don't think, never really payed attention on that.<!--content-->The CGI script is on my server. I bought the script but it is unreadable when you open it. I can read all my other scripts. The names of the checkboxes are correct because they come from an existing form.<br />
I have no idea why it doesn't work. Perhaps the " shouldn't be there?<br />
<br />
Hanno<!--content-->can you upload the script?<!--content-->Here it is.<!--content-->that sucks... what language is it in?<!--content-->Checkboxes return a string of value pairs. eg. hobby=golf hobby=reading hobby=fishing etc., one pair for each box that's checked.<br />
<br />
<input type="checkbox" name="hobby" value="golf"> Playing Golf <br><br />
<input type="checkbox" name="hobby" value="reading"> Pornography<br><br />
<input type="checkbox" name="hobby" value="fishing"> Catching Fish<br><br />
<br />
So you need to say:<br />
<input type="hidden" name="hobby" value="fishing"><!--content-->but he wasn't getting the value when he did it. the cgi isn't looking for hidden inputs but only something that gets put in the URL. he said what ever he tried it wasn't coming out correctly.<!--content-->Found it (well I was told).<br />
<br />
The checkbox returns "on". This one I hadn't tried before.<br />
<br />
Thanks for your help!<!--content-->a check box returns "on" which is "1" or "true". all the samething. it will still return the value of the check box just like a hidden field will.<!--content-->
 
Back
Top