1
BigJim
Javascript advice please!!!
  • 2009/5/13 6:58

  • BigJim

  • Just popping in

  • Posts: 78

  • Since: 2007/7/16


Hi guys, I'm trying to get this javascript working on my XOOPS site. I've made the below javascript code so that users can search all modules in the site from just one text box - there is a search button for each module so users simply enter their keywords and press one of the search buttons according to module they want to search.

The thing is it works fine in firefox but not at all in ie - can anyone tell me why its not working in ie?

Quote:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head></head>
<body>
<SCRIPT language="JavaScript">
function OnSubmitForm()
{ if(document.pressed == 'questions') { document.myform.action ="/modules/newbb/search.php"
document.getElementById("mids[]").value = '6' document.getElementById("query").name = "term" }

else if(document.pressed == 'rankings') { document.myform.action ="/modules/smartsection/search.php"; document.getElementById("mids[]").value = '91' document.getElementById("query").name = "query" }

else if(document.pressed == 'courses') { document.myform.action ="/modules/classifieds/search.php"; document.getElementById("mids[]").value = '3' document.getElementById("query").name = "query" }
return true; }

</SCRIPT>

<FORM name="myform" method="GET" onSubmit="return OnSubmitForm();">
<input name="" id="query" type="text" size="40" />
<input type="hidden" name="mids[]" id="mids[]" value=""/> <input type="hidden" name="forum[]" id="forum" value="all" /> <input type="hidden" name="searchin" id="searchin" value="both" />
<input type="hidden" name="sortby" id="sortby" value="p.post_time desc" /> <input type="hidden" name="andor" id="AND" value="AND" />
<input type='hidden' name='action' id='action' value='results' />
<input type="hidden" name ="level" value= "ALL"/>
<input type="hidden" name="action" value = "results"/>
<input type="hidden" name="id" value = ""/>
<input type="hidden" name="apply_by" value = "Sept"/>

<INPUT TYPE="SUBMIT" name="submit" onClick="document.pressed=this.value" VALUE="questions">

<INPUT TYPE="SUBMIT" name="submit" onClick="document.pressed=this.value" VALUE="rankings">

<INPUT TYPE="SUBMIT" name="submit" onClick="document.pressed=this.value" VALUE="courses">

</FORM>
</body>
</html>


thanks a lot for any help!!!!!

Login

Who's Online

198 user(s) are online (122 user(s) are browsing Support Forums)


Members: 0


Guests: 198


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits