views:

44

answers:

3

Hi, i am having this same issue using IE7 and jqery 1.4 problem is : i have a popup like this

<div id="model_content_savefilter" style="display:none;">
    <div style="display:none;" id="SaveFilterErrorMessage" class="errorMessage"></div>
    <table id="save_filter_modal" cellpadding="0" cellspacing="0" border="0">
        <tr><td>You are saving a filter that shows balances for</td></tr>
        <tr><td>Please choose a name for your filter</td></tr>
        <tr><td><input id="saveFilterTxt" name="saveFilterTxt" type="text" value="" /></td></tr>
        <tr>
            <td><input type="button" onclick="javascript:saveFavourite('operateOnFavouriteFilter.htm',1,'','H')" value ="Save"/></td>
            <td width="20%"><a href="#" id="cancelFilter">Cancel</a></td>
        </tr>
    </table>
</div>

and Javascript function is like this

function saveFavourite(action, id,queryString,inputTxtValue) {
    alert("hi :");
    alert($('#model_content_savefilter input[type=text]:first').val());
    alert("val :" + document.getElementById("saveFilterTxt").value);
}

every time value is coming empty Pls hel

A: 

It works just fine for me - see http://jsfiddle.net/Tmxvh/

If you're still having trouble, go ahead and create a jsfiddle that reproduces the problem.

TML
A: 

Try this,

 $('input[type=button]').live("click", function() {
     alert("hi :");
     alert($('#model_content_savefilter input[type=text]:first').val());
     alert("val :" + document.getElementById("saveFilterTxt").value);
 });
Manie
This what i did when i have to get a value in the form coming from a popup... don't forget to use .live("click"...
Manie
also remove the onclick attribute on your input button since you have this..
Manie
A: 

yes when i run it as a static code in the HTML it runs fine but not when i run this same code in my application as a pop up - div overlay only

i tried with his $('input[type=button]').live("click", function() also but still same problem

tarun k