PDA

View Full Version : Web page acting very strange with text field


mr_evans2u
06-18-2003, 05:43 PM
my page is acting very strange and I can't figure out why. When I bring up this page it "should" have focus on this text field, but it doesn't. Even if I click on the text field it doesn't give it focus, but if I click anywhere else then it seems to kick in and puts the cursor in the text field. Below is the section of code for the text field. Even if I take the onblur out I still can't get a cursor until I click else where first.

Any suggestions?


<HTML><HEAD>
<TITLE>Sieve Filter Administration</TITLE>
<BODY BACKGROUND="gray.jpg" onbeforeunload="closeIt()">
<SCRIPT LANGUAGE="javascript" SRC="load.js"></SCRIPT>

</HEAD>
<FORM METHOD="POST" ACTION="add_sieve.cgi" name="AddSieve_form">
<TABLE BORDER="0" CELLSPACING="0" CELLPADDING="0">
<BR>
<H4 ALIGN="center"><B>Connected to $relay_label</B></H4>
<H3 ALIGN="center"><B>Add Sieve Filter Section</B></H3>
<TR>
<TD>
<HR>

<B>Section Name:&nbsp;</B>
<input type="text" name="SecName" size="50" maxlength="50" onBlur="checkSecName(this.form.SecName.value)">

redhead
06-18-2003, 06:36 PM
Have you tried something like this?

<body ... onload="document.AddSieve_form.SecName.focus()">

I see nothing in that code that should focus the box... also:

onBlur="checkSecName(this.form.SecName.value)"

Should be:

onBlur="checkSecName(this.value)"

mr_evans2u
06-18-2003, 09:21 PM
redhead,
onBlur="checkSecName(this.form.SecName.value)"
works fine once the focus is on this field.
as far as the focus, this is what I have: <SCRIPT LANGUAGE="javascript">document.AddSieve_form.SecName.focus()</SCRIPT>

I've checked this with other pages that we have created and it works, but for some reason the focus isn't working this time.