I have a tabbed container and a button (not in the container) on a page. If the first tab is selected, I want the button enabled. If the second is selected, I want the button disabled. I have created this functionaliity, but I have encountered some odd behavior. Switching tabs is handled client-side, and therefore, when the tabs are switched, I use something like the following to enable/disable the button client-side based on which tab is selected:view plaincopy to clipboardprint?var saveButton = document.getElementById("<%= btnSave.ClientID %>") if (saveButton) { saveButton.disabled=false; if mytab=="Tab2") { saveButton.disabled=true; } } var saveButton = document.getElementById("<%= btnSave.ClientID %>") if (saveButton) { saveButton.disabled=false; if mytab=="Tab2") { saveButton.disabled=true; } }view plaincopy to clipboardprint? view plaincopy to clipboardprint?This works great but the first problem I run into is, if a control on the second tab (the button is disalbed when this tab is selected) causes a postback, then after the postback the button's state is returned to enabled. This sort of makes sense since the page lifecycle, at this point, knows nothing about what the button state should be. I decided the solution to this would be to check what the current tab is during page load, and if it is the second tab, set the button enabled property to false. In this way, when a postback occurs on the second tab, the button remains disabled. Well, this works to a charm, but I encountered a bizzare side-effect. This works great but the first problem I run into is, if a control on the second tab (the button is disalbed when this tab is selected) causes a postback, then after the postback the button's state is returned to enabled. This sort of makes sense since the page lifecycle, at this point, knows nothing about what the button state should be. I decided the solution to this would be to check what the current tab is during page load, and if it is the second tab, set the button enabled property to false. In this way, when a postback occurs on the second tab, the button remains disabled. Well, this works to a charm, but I encountered a bizzare side-effect.view plaincopy to clipboardprint? view plaincopy to clipboardprint?On the second tab, a postback is caused. The button remains disabled as it should be. I then swith tabs. The client-side code goes into effect and the button client-side disabled property is set to false. However the strange thing is, now the button doesn't work. Clicking on it does not cause a postback and doesn't really do anything. It seems that setting the button enabled property to false and then true server-side, somehow doesn't jive with setting it's disabled property to false on the client. On the second tab, a postback is caused. The button remains disabled as it should be. I then swith tabs. The client-side code goes into effect and the button client-side disabled property is set to false. However the strange thing is, now the button doesn't work. Clicking on it does not cause a postback and doesn't really do anything. It seems that setting the button enabled property to false and then true server-side, somehow doesn't jive with setting it's disabled property to false on the client.view plaincopy to clipboardprint? view plaincopy to clipboardprint?anyone have an idea what is going on?
New to Arrays
Hi I am new to PHP (a week and a half now) and I am just beginning to read about arrays. I understand simple arrays, associative arrays, and multidimensional arrays also. The book I am reading
with clause
hi all, i have a big query that usually access the same table more than once. for example, i have something like this
php automatically escaping single quotes
I'm trying to test out my security a bit and I've noticed that php is escaping my single quotes. For instance I enter x' OR 1=1-- in a form and the output it gives me is x\' OR 1=1--.Is there a
how to get IP address?
hey guys,i have this code which is supposed to get me the IP address of my site visitors:Code: <?php if ($_SERVER['HTTP_X_FORWARD_FOR']) {$ip = $_SERVER['HTTP_X_FORWARD_FOR'];} else {$ip =
PHP Thumbnail Creation
Ok so i use this function to create thumbnails:Code: [Select]function createthumb($name,$filename,$new_w,$new_h){ $system=explode('.',$name); $src_img=imagecreatefrompng($name);
Save remote XML to local website folder
Hi, I hope you can help me out. I would like to be able to pull an XML file from another site and then store it in a local folder on my site. That way, I would only need to pull the xml file once in
php mailer
How can i send a mail to large no, say 50,000 reciepients using [color=#0000FF]php mailer[/color]
Best way to cross matching large datasets
Hi,Im running a script where am I cross matching about 200 000 data sets with each other. Each data set consists of 8 parameters and I want to count all datasets which have similar or the same
PHP Script runs on CLI but not through web browser
I am running into an issue that I just can't seem to find the answer to. I have a Windows Server 2008 box that is running Apache 2.2.14, PHP 5.2.11, and MySQL 5.1.39. My problem is I am trying to call
PHP error on MySQL insert
I'm sure it's the simplest of issues, but I can't recall why this isn't working.Code: [Select]<?php//setup our insert command$sql = "INSERT INTO `my_db_name`.`my_table_name` (`id`,