473,856 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Searchable TextBox using window.showModa lDialog

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.a spx?client=" + Form1.client.va lue;
var tSearch = window.showModa lDialog(tURL);
Form1.tClientId .value = tSearch;
Form1.submit();
}

My modGetClient.as px 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.returnVa lue 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_TextC hanged that i need to fire when it gets set by my
client-side fnClient function.
The tClientId_TextC hanged 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 2689
DOH!

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

Seems to work exactly as i require

Thanks anyway

Dan
da**********@ne wcross-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.a spx?client=" + Form1.client.va lue;
var tSearch = window.showModa lDialog(tURL);
Form1.tClientId .value = tSearch;
Form1.submit();
}

My modGetClient.as px 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.returnVa lue 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_TextC hanged that i need to fire when it gets set by my
client-side fnClient function.
The tClientId_TextC hanged 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
16151
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 showModalDialog. It is modal as far as the client is concerned but not the server... In my app I have a datagrid on the main aspx page, I pop up a modal dialog to edit a record. On closing the modal dialog I'd like to refresh the
8
7425
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 assign value form the object to text Box it gives error 'Object required' Dim strResponse As String strResponse = strResponse & "<script language=""JavaScript"">" & vbCrLf strResponse = strResponse & "var aForm; " & vbCrLf
3
1466
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 String = "<script language" & "='javascript'>window.showModalDialog('frm_MoreInfo.aspx?ProductImage=" & str_ImageName & "&ProductDesc=" & str_Description & "','dialogWidth: 100px;dialogHeight: 100px;center: yes;resize: no;status: no;help:...
4
2708
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 be populated in the textbox. I use the user control on a index.aspx page. In order to achieve this I have a selected intexchange event on the calendar control. I pass the textbox id using the querystring when the button is clicked and then...
1
3582
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 allows the user to open the page containing the link in a regular window or one opened via window.showModalDialog( ) 2. modal.htm provides a link to the aspx which generates the csv 3. csv.aspx generates a csv file
2
4403
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 when generated from within a page opened with window.showModalDialog( ) ( IE6 ). To isolate this problem, I've written 3 files (see below). 1. main.htm allows the user to open the page containing the link in a
9
4664
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();" + "}" + "</script>";
1
2725
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 support drag and drop objects from itself to the popup window - wait for user response in popup window and return results back to the parent window (i.e. calling showModalDialog() is preferred)
0
9765
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10700
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10795
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10390
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7934
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5763
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5962
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4581
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3203
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.