Jump to content

ONCLICK in <form>: don't works pressing enter. Does works mouse clicking


Rosky
 Share

Recommended Posts

:) On page XHTML Strict have this form, works fine mouse clicking, don't works pressing enter from keyboard....The form:--------------------------------------------------------------<html><body>form method="POST" name="REQUEST" action="/congrea/wwwi32.exe/[in=affiche.in]"><td align="left" width="60%"><input type="submit" OnClick="java script:SubmitForm();" value="BUSCAR"> <input type="button" OnClick="java script:ResetForm();" value="Borrar"> </td></tr></table><input type="hidden" name="t2000"><input type="hidden" name="t2001"><input type="hidden" name="t2002"><input type="hidden" name="t2003" value="20"><input type="hidden" name="t2004" value="1"></form><form method="POST" name="INDEX" action="/congrea/wwwi32.exe/[in=index.in]"><input type="hidden" name="t2000"><input type="hidden" name="t2001"><input type="hidden" name="t2002"><input type="hidden" name="t2003"><input type="hidden" name="t2004"><input type="hidden" name="t2006"></form></body></html>---------------------end paste -------------------------------------------The matter is when user does mouse click, works fine, but when does ENTER with keyboard, don't works ENTER key and browser shows: "HTTP Error 405.0 - Method Not Allowed.The page you are looking for cannot be displayed because an invalid method (HTTP verb) is being used."... The Javascript is:CODE<!--function SubmitForm() {requete="";savreq="";question="";opet=" y ";opou=" o ";flag=false;MakeRequest(" AND ",ReadTextBox("V1","1"),"$","Todos los campos","",""," OR ");MakeRequest(ReadListSimple("V2"),ReadTextBox("V3","1"),"$","Nombre/s y apellido/s","/(10)",""," OR ");MakeRequest(ReadListSimple("V4"),ReadTextBox("V5",""),"","Búsqueda por EXACTOS 'Apellido/s,Nombre/s' ","/(11)",""," OR ");MakeRequest(ReadListSimple("V6"),ReadListMulti("V7"),"","Cantidad de mandatos","/(130)","",ReadRadio("V8"));MakeRequest(ReadListSimple("V9"),ReadListMulti("V10"),"","Período de mandato","/(21)","",ReadRadio("V11"));MakeRequest(ReadListSimple("V12"),ReadListMulti("V13"),"","Distrito","/(31)","",ReadRadio("V14"));MakeRequest(ReadListSimple("V15"),ReadTextBox("V16","1"),"$","Partido Político","/(40)","",ReadRadio("V17"));MakeRequest(ReadListSimple("V18"),ReadTextBox("V19",""),"","Busque por nombre oficial de los partidos","/(41)",""," OR ");MakeRequest(ReadListSimple("V20"),ReadListMulti("V21"),"","Reemplazos","/(51)","",ReadRadio("V22"));MakeRequest(ReadListSimple("V23"),ReadListMulti("V24"),"","Actas y diplomas","/(61)","",ReadRadio("V25"));MakeRequest(ReadListSimple("V26"),ReadListMulti("V27"),"","Renuncias","/(71)","",ReadRadio("V28"));MakeRequest(ReadListSimple("V29"),ReadListMulti("V30"),"","Fallecimientos","/(81)","",ReadRadio("V31"));MakeRequest(ReadListSimple("V32"),ReadListSimple("V33"),"","Comicios anulados","/(91)","",ReadRadio("V34"));MakeRequest(ReadListSimple("V35"),ReadListMulti("V36"),"","Clausuras del Poder Legislativo","/(101)","",ReadRadio("V37"));MakeRequest(ReadListSimple("V38"),ReadListMulti("V39"),"","Desafueros, ceses, etc.","/(111)","",ReadRadio("V40"));MakeRequest(ReadListSimple("V41"),ReadListMulti("V42"),"","Otros (Supl., Licen., etc.)","/(121)","",ReadRadio("V43"));if (flag == false) { alert("Indique un término de búsqueda..."); return;}document.REQUEST.t2000.value = requete;document.REQUEST.t2001.value = savreq;document.REQUEST.t2002.value = question;document.REQUEST.t2003.value = ReadListSimple("V45");document.REQUEST.action = document.REQUEST.t2009.value+"/[in=genisis"+document.REQUEST.t2013.value+"0.in]/";document.REQUEST.submit();}//-->I has tried with <input type="submit".... "onkeypress"... etc. but nothing run well... Any idea??
Link to comment
Share on other sites

I can't see how it wouldn't work.It's as simple as this:<form method="POST" name="REQUEST" action="/congrea/wwwi32.exe/[in=affiche.in]" onsubmit="SubmitForm(); return false;">

Link to comment
Share on other sites

I can't see how it wouldn't work.It's as simple as this:<form method="POST" name="REQUEST" action="/congrea/wwwi32.exe/[in=affiche.in]" onsubmit="SubmitForm(); return false;">
yes, :) that's right, it worked after replacing <input type="button" x <input type="submit" ... Thanks :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...