|
|
|
|
|
|
Linux Hosting NT/2000 Hosting DYO Internet Access HTMLez.com JAVASCRIPTez.com PHPez.com
|
You can, after a fashion, pass javascript values to ASPHTML, via web forms, passes values to server-side languages such as .asp. And .asp can create client-side code such as html or javascript. But it's commonly held that javascript can't pass values to server-side code such as .asp. And that's of course true in fact. But the effect in some instances can be achieved.I wrote an application where I used pop-ups via the javascript newwindow function to update database information. I did not want the user to hit the Refresh button in the browser and save the information a 2nd time or to over-write updated information. Performing the INSERT or UPDATE functionality via popups executing the .asp database code and then automatically closing via the javascript self.close(); function helped in solving this problem. The use saw action taking place and didn't refresh the screen simply because he/she thought the action was taking too long. And the popup method causes only 1 instance of the application to appear in browser history. The use no longer presses the back key, gets distracted, and then saves old data. But there was a problem! Popups meant passing data via the querystring method. Querystring is limited so textarea boxes with extended text lost data through truncation. I wanted the popup screen to read form data via the javascript opener functionality. Too late! The .asp code had already executed. So I launch the popup without sending querystring parms and wrap the popup within a conditional requesting existence of a parm value. When the parm value doesn't exist I create use the form tag to store the values obtained from the opener... notation into hidden input fields and use javascript to execute this form. Upon re-execution, the parm value now exists and the .asp code performs the database manipulation and the javascript window closing. Check it out using the following links: Functioning SampleIf you also have a website assisting web authors, please feel free to link to either this page or to link to ASPez.com. If you would like to contribute code to any of the EZ pages referenced on the left, Please email me here. You may also email me if you would like to exchange links (compatible sites only).
|
Average Customer Review: http://www.wrox.com |