complex form

HI all... Im having a some trouble with a form I am workin on. The form is to call a php script so I have put it in the action="searchclas.php" and method="get" Now I have several drop down menus, that serve as keywords for the search, in each of the optins I have value="optionname" according to the name of the option. After the 3 drop down menus, there is a text box for users to further filter their searches. Below the text box there is an image that is to be used as a submit button. Only it is an image map... ok so on the map tag I added "href=http://www.htmlforums.com/archive/index.php/"javascript:document.forms[0].submit();"" and closed the form tag after it. Now these are my questions:<br />
<br />
1. I need the values to be placed in the header like so ...searchclas.php?city=nyc?category=machinery? etc etc... it has to add all of the values there, even if the user doesnt select something from the drop down menu, it should return the value "all" in the header, this is important so I can grab that value to filter the search... Same for the input box, it has o put the users input as a value in the header...<br />
<br />
2. For some reason when I click on the submit button it just reloads the same page. I dont know if this is the right syntax "href=http://www.htmlforums.com/archive/index.php/"javascript:document.forms[0].submit();"" I dont get any errors so I am supposing it is, but a) why doesnt it get searchclas.pho which is the action of the form, and b) it doesnt show my variables in the header, (or address if you will) Does that javascript have to be configured according to the name of my form or somehting, and if so, what should I change? Is this the problem? HELP!!!! Thank you very much!<br />
<br />
Ted<br />
<br />
PS heres a link so you can understand: <br />
<br />
<!-- m --><a class="postlink" href="http://puebla.scinet.com.mx/tedc/ccepuebla.org/frontend/serv_clasificados.php">http://puebla.scinet.com.mx/tedc/ccepue ... icados.php</a><!-- m --><!--content-->I like to name and id my forms, instead of referencing them by array value (form[0]). below is an example I whipped up. You'll notice a bit of JS in the onclick handler of the submit button that assigns a default value to the text field "color" if none has been typed in. Give it a go. When you submit, it should fail but in the url you'll see the variable and value pairs. <br />
<br />
<br />
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><br />
<br />
<html><br />
<head><br />
<title>Untitled</title><br />
</head><br />
<br />
<body><br />
<form name=form1 id=form1 action="http://somewhere.php" method="get"><br />
<input type=text name=color>Color<br><br />
<select name=car><br />
<option value=all>All...</option><br />
<option value=bmw>BMW</option><br />
</select><br><br />
<input type=radio name=style value="3 series" checked>3 series<br><br />
<input type=radio name=engine value="5 series">5 series<br><br><br />
<input type=submit onclick="if (!(document.form1.color.value)){document.form1.color.value='noPreference'}"><input type=reset><br />
</form><br />
</body><br />
</html><!--content-->Thanks a lot ofr your help... Ive had a few responses on opther forums but none where as straightforward as this one, thanks.<!--content-->couldn't you just use<br />
<br />
href=http://www.htmlforums.com/archive/index.php/"java script:document.submit();""<br />
<br />
instead of<br />
<br />
href=http://www.htmlforums.com/archive/index.php/"java script:document.forms[0].submit();""<br />
<br />
<br />
I would think that would submit your page according to the action of the form.<!--content-->
 
Back
Top