D
dan_williams
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
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