Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Searchable TextBox using window.showModalDialog

Reply
Thread Tools

Searchable TextBox using window.showModalDialog

 
 
dan_williams@newcross-nursing.com
Guest
Posts: n/a
 
      06-06-2006
I'm trying to create a textbox control on an asp.net web page, that
after a user has typed some text into it, another pop-up window appears
with a dropdownlist populated with options related to the text the user
entered.

My initial attempt was to create a javascript function that executes on
the onblur event of my textbox. My javascript function is as follows:-

function fnClient() {
var tURL = "modGetClient.aspx?client=" + Form1.client.value;
var tSearch = window.showModalDialog(tURL);
Form1.tClientId.value = tSearch;
Form1.submit();
}

My modGetClient.aspx page simply executes the following SQL statement
and populates a dropdownlist with all the resulting records. Once the
user clicks on an OK button, a javascript function sets the
window.returnValue to the selected option and the window gets closed.

SELECT ClientId FROM Clients WHERE BusinessName LIKE '%" +
Request("client") + "%' "

The tClientId is a hidden textbox value and I have server-side Sub
tClientId_TextChanged that i need to fire when it gets set by my
client-side fnClient function.
The tClientId_TextChanged function basically populates other form
fields based on the clientId selected from the modalDialog box.
However, it only seems to fire after i actually physically type
something in the hidden field (i made it a text type to test it).
Therefore, i added the Form1.submit() function to force a postback, but
this causes my validation controls to fire, which i don't want.

Can anyone recommend a way of doing this? Am i going down the right
route with a showModalDialog box? Is it possible to prevent page
validation from happening? Is it possible to call a server-side
function from client-side javascript?

Please help!!!

Dan

 
Reply With Quote
 
 
 
 
dan_williams@newcross-nursing.com
Guest
Posts: n/a
 
      06-06-2006
DOH!

It's OK, i managed to work it out for myself. Instead of performing the
Form1.submit(); i use __doPostBack('tClientId_TextChanged', '');

Seems to work exactly as i require

Thanks anyway

Dan


http://www.velocityreviews.com/forums/(E-Mail Removed) wrote:
> I'm trying to create a textbox control on an asp.net web page, that
> after a user has typed some text into it, another pop-up window appears
> with a dropdownlist populated with options related to the text the user
> entered.
>
> My initial attempt was to create a javascript function that executes on
> the onblur event of my textbox. My javascript function is as follows:-
>
> function fnClient() {
> var tURL = "modGetClient.aspx?client=" + Form1.client.value;
> var tSearch = window.showModalDialog(tURL);
> Form1.tClientId.value = tSearch;
> Form1.submit();
> }
>
> My modGetClient.aspx page simply executes the following SQL statement
> and populates a dropdownlist with all the resulting records. Once the
> user clicks on an OK button, a javascript function sets the
> window.returnValue to the selected option and the window gets closed.
>
> SELECT ClientId FROM Clients WHERE BusinessName LIKE '%" +
> Request("client") + "%' "
>
> The tClientId is a hidden textbox value and I have server-side Sub
> tClientId_TextChanged that i need to fire when it gets set by my
> client-side fnClient function.
> The tClientId_TextChanged function basically populates other form
> fields based on the clientId selected from the modalDialog box.
> However, it only seems to fire after i actually physically type
> something in the hidden field (i made it a text type to test it).
> Therefore, i added the Form1.submit() function to force a postback, but
> this causes my validation controls to fire, which i don't want.
>
> Can anyone recommend a way of doing this? Am i going down the right
> route with a showModalDialog box? Is it possible to prevent page
> validation from happening? Is it possible to call a server-side
> function from client-side javascript?
>
> Please help!!!
>
> Dan


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
searchable website question Drew HTML 0 09-10-2006 11:29 AM
How do i make my asp.net app "searchable" via google? news.microsoft.com ASP .Net 1 12-26-2005 02:13 PM
Searchable ComboBoxes Craig G ASP .Net 1 03-23-2005 01:47 PM
Searchable Combobox In ASP.NET Vadim ASP .Net 4 02-27-2005 04:17 PM
Some sort of searchable or two way Map Albretch Java 7 09-27-2004 05:42 PM



Advertisments