473,324 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

Searchable TextBox using window.showModalDialog

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

Jun 6 '06 #1
1 2652
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
da**********@newcross-nursing.com 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


Jun 6 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Simon Storr | last post by:
Is it possible to make the parent window refresh when a modal dialog is closed? I know I can use window.opener.location.reload(true); for a 'normal' window, but this doesn't work for...
8
by: Sergei | last post by:
Hi, I am displaying modal dialog and passing values from the main form to the modal dialog and back. It works fine but if I used the following syntax on Page_Load(just for testing) in VB to...
3
by: csgraham74 | last post by:
Hopefully someone can help me with this i dont seem to be able to find a javascript - asp.net group. im trying to creat a modal dialog box in asp.net using the following Dim str_JavaPopup As...
4
by: Samy | last post by:
Hi There, I have a user control with a textbox and a button which when clicked opens a calendar control(calendar.aspx page). When I select a date from the calendar control, the date is supposed to...
1
by: John | last post by:
Hi, I'm having a problem opening / downloading csv files when called from a page opened with window.showModalDialog( ). To isolate this problem, I've written 3 files (see below). 1. main.htm...
2
by: John | last post by:
Hi, I posted this earlier in microsoft.public.dotnet.framework.aspnet, but didn't get a response, so I thought I'd try here. Basically, I'm having a problem opening / downloading csv files...
9
by: Stan B | last post by:
I create a popup window by calling window.showModalDialog Popup window has Ok button with this code attached: === string Script = "<script language=JavaScript>" + "{" + "window.close();" +...
1
by: elizayiu | last post by:
Hi, I need to write a webpage which does the following: - open up a window and pass parameters into it (i.e. need to call showModalDialog() or showModelessDialog()) - contains jscript to...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.