enter key hell problem 1

G

gh0st54

Hi
here is the situation
I have a login page with 2 user control
one for login one for registering new members

i want to be able to press enter to submit the form to the proper
submit button based on filled fields

the thing is there is no __EVENTTARGET
even if is register one as

Page.RegisterHiddenField("__EVENTTARGET", "Login1_btnSubmit");

it doesn't fire

what am i doing wrong ???
 
S

Steve C. Orr [MVP, MCSD]

G

gh0st54

thanks for the reply but i had seen those earlier here are my scripts
on the page

but then i have to verify the EVENTTARGET value on reply, i don't
want to do that

what i was looking for is why won't my __EVENTTARGET fire with my
default value set in code ???


function document.onkeydown()
{

if(event.keyCode ==13){
event.returnvalue=false;
event.cancel =true;

var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape")
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.submit();
}
}

function SetTarget(targetvalue){
var theform;
if (window.navigator.appName.toLowerCase().indexOf("netscape") >
-1) {
theform = document.forms["Form1"];
}
else {
theform = document.Form1;
}
theform.__EVENTTARGET.value = targetvalue;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top