Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Submitting a form with focus in combo box

Status
Not open for further replies.

Romanichine

Programmer
Apr 9, 2002
30
CA
Hi,

We have a form using a Combo Box component, which works fine except for one problem: When the focus is in the combo box and the user hit the submit button, it does not submit the form. The user has to hit submit a second time to really submit it. The first hit on sbumit only removes the focus from the combo box.

If the focus is on any other boxes on the form (textareas, listboxes etc..) it works on the first click.

Anyone has ever seen this?

Here's the code for the Combo box:
=======
<OBJECT codebase=&quot;../common/SPARCodebase.CAB&quot;
NAME=&quot;cboPOPORG&quot;
STYLE=&quot;WIDTH: 160px; HEIGHT: 24px&quot;
CLASSID=&quot;clsid:8BD21D30-EC42-11CE-9E0D-00AA006002F3&quot;
TABINDEX = 17
VIEWASTEXT id=OBJECT1>
<PARAM NAME=&quot;Locked&quot; VALUE=&quot;True&quot;>
<PARAM NAME=&quot;VariousPropertyBits&quot; VALUE=&quot;746604571&quot;>
<PARAM NAME=&quot;Style&quot; VALUE=&quot;2&quot;>
<PARAM NAME=&quot;BackColor&quot; VALUE=&quot;2147483653&quot;>
<PARAM NAME=&quot;ForeColor&quot; VALUE=&quot;2147483656&quot;>
<PARAM NAME=&quot;MaxLength&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;BorderStyle&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;ScrollBars&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;DisplayStyle&quot; VALUE=&quot;3&quot;>
<PARAM NAME=&quot;MousePointer&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Size&quot; VALUE=&quot;4286;635&quot;>
<PARAM NAME=&quot;PasswordChar&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;ListWidth&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;BoundColumn&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;TextColumn&quot; VALUE=&quot;65535&quot;>
<PARAM NAME=&quot;ColumnCount&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;ListRows&quot; VALUE=&quot;8&quot;>
<PARAM NAME=&quot;cColumnInfo&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;MatchEntry&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;ListStyle&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;ShowDropButtonWhen&quot; VALUE=&quot;2&quot;>
<PARAM NAME=&quot;ShowListWhen&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;DropButtonStyle&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;MultiSelect&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;Value&quot; VALUE=&quot;&quot;>
<PARAM NAME=&quot;Caption&quot; VALUE=&quot;&quot;>
<PARAM NAME=&quot;PicturePosition&quot; VALUE=&quot;458753&quot;>
<PARAM NAME=&quot;BorderColor&quot; VALUE=&quot;2147483654&quot;>
<PARAM NAME=&quot;SpecialEffect&quot; VALUE=&quot;2&quot;>
<PARAM NAME=&quot;Accelerator&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;GroupName&quot; VALUE=&quot;&quot;>
<PARAM NAME=&quot;FontName&quot; VALUE=&quot;Verdana&quot;>
<PARAM NAME=&quot;FontEffects&quot; VALUE=&quot;1073741824&quot;>
<PARAM NAME=&quot;FontHeight&quot; VALUE=&quot;180&quot;>
<PARAM NAME=&quot;FontOffSet&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;FontCharSet&quot; VALUE=&quot;0&quot;>
<PARAM NAME=&quot;FontPitchAndFamily&quot; VALUE=&quot;2&quot;>
<PARAM NAME=&quot;ParagraphAlign&quot; VALUE=&quot;1&quot;>
<PARAM NAME=&quot;FontWeight&quot; VALUE=&quot;400&quot;>
</OBJECT>
======

Thanks,
Roman
 
maybe this can help (i'm not sure):
change the submit button in the form to a ordinary button and add an onClick event that changes the focus first and then submits the form...

<input type=&quot;button&quot; value=&quot;submit&quot; onClick=&quot;this.focus();document.yourform.submit();&quot;>
 
Is this a third party control? If it is, I doubt there is anything you can do. Maybe contact the vendor and see what they suggest as a solution.
Thanks,

Gabe
 
TomasCrossroads: It didn't help but thanks for replying. The combo box does not like Javascript.

GabeC: It's not 3rd party, it's Microsoft. I believe it ships with IIS or VB.

For the record I found the following solution: I created a function that remove the focus from the combo box whenever it changes.

Sub cboPOPORG_Change()
window.frmService.cboPOPDST.focus
End Sub


--
Roman
 
In this instance I consider Microsoft a third party vendor. What you are using is not a standard HTML input field.

Microsoft didn't invent the internet (that was Al Gore), they just control it.


Thanks,

Gabe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top