dikmus
Posts: 19
|
| Posted: 06/08/2005, 12:11 PM |
|
I want to get rid of the search button.
Is there a simple way to do this?
(using javasript or vb.net)
_________________
www.musit.nl |
 |
 |
Nicole
Posts: 586
|
| Posted: 06/09/2005, 4:58 AM |
|
Hello,
You can submit a search form via Javascript code in listbox onChange event:
document.forms.search_form_name.submit();
_________________
Regards,
Nicole |
 |
 |
dik mus
|
| Posted: 06/09/2005, 6:24 AM |
|
Hi nicole,
I thought so too, but in my page nothing happens.
I also tried to add the action submit on the onchange event of the listbox, but same result.
(only if i press the search button, the page is submitted)
could i be forgetting something? It could be something very basic 
(generating vb.net code)
|
|
|
 |
DonB
|
| Posted: 06/09/2005, 8:11 PM |
|
Put a javascript alert('some message') into the event to be sure it's
actually getting triggered.
--
DonB
http://www.gotodon.com/ccbth
<dikmus@forum.codecharge (dik mus)> wrote in message
news:242a84329f1b25@news.codecharge.com...
> Hi nicole,
> I thought so too, but in my page nothing happens.
> I also tried to add the action submit on the onchange event of the
listbox, but
> same result.
> (only if i press the search button, the page is submitted)
> could i be forgetting something? It could be something very basic 
> (generating vb.net code)
>
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
E43509
Posts: 283
|
| Posted: 06/16/2005, 1:59 PM |
|
Assuming you are using .net, I brute forced it in this way by snooping around the code for how a navigator link works.
This does not work
myControl.Attributes("OnChange") = "javascript:this.form.submit();"
As you need to do some kind of a postback like the navigator controls
This worked for me
myctl.Attributes("OnChange") = "javascript:__doPostBack('mySearchButton_DoSearch','')"
Remember that for add Javascript to any controls in .net, you have to do it programmatically.
|
 |
 |
dik mus
|
| Posted: 06/17/2005, 12:11 AM |
|
Interesting that you did get it to work. Very good!
But where exactly did you put the code?
I am indeed using .net (and still wondering why)
|
|
|
 |
E43509
Posts: 283
|
| Posted: 06/17/2005, 8:14 AM |
|
I'm only part way skilled in .net so there may be better ways.
I put the code in the event for the form (before show).
|
 |
 |
dik mus
|
| Posted: 06/18/2005, 12:23 AM |
|
Finally got this working too!! Thanks a lot.
Adding code to vb.net applications is not as simple as i had hoped.
The only place where i managed to get some code exceuted in vb.net is in the before show event. I dont realy onderstand why. But this is working great.
|
|
|
 |