jquery

Scroll to same Position on reload and load

时光怂恿深爱的人放手 提交于 2021-02-08 10:36:08
问题 i have a webpage that is full of div's with huge length, so whenever I refresh my page or manual document loading through actions, i need to scroll my window or document to same or previous position, but i want that to be done by browser automatically. i searched it in web and found no help, but i came to know that solution is there with out any other lib inclusion. I have a page of height more exceeds window height with some divs and select boxes whenever i select any thing in middle of page

passing file to controller without using form,

丶灬走出姿态 提交于 2021-02-08 10:35:16
问题 guys i am trying to load file from view to controller with out using form , while browsing a file the file should be loaded to controller using Ajax ,is it possible? <td>Import Excell file:</td> <td><input type="file" id="fileUpload" name="fileUpload" /></td> $('#fileUpload').die().live("change", function (e) { e.preventDefault(); var file_name = $("#fileUpload").val(); var fileName = $("#fileUpload").val(); var fileExtension = fileName.substring(fileName.lastIndexOf('.') + 1); var file_data

optgroup with all option

纵然是瞬间 提交于 2021-02-08 10:33:41
问题 my select option group is like <select multiple class="form-control form-white" data-placeholder="Select Courses"> <option value="all">All</option> <optgroup label="Play School"> <option value="1">All</option> <option value="2">Sec A</option> <option value="3">Sec B</option> </optgroup> <optgroup label="Nursery"> <option value="1">All</option> <option value="2">Sec A</option> <option value="3">Sec C</option> </optgroup> <optgroup label="LKG"> <option value="1">All</option> <option value="2"

jquery functions inside of dynamically generated html not working [duplicate]

有些话、适合烂在心里 提交于 2021-02-08 10:31:44
问题 This question already has answers here : Event binding on dynamically created elements? (23 answers) Closed 5 years ago . I looked up the load method to find an alternative to php includes. I got the load to add html dynamically and it works. The one issue though is that function aren't working. I think it's either an order issue, structure issue or plain logic. Any help to get my functions to work in dynamically generated html would be greatly appreciated. Sample structure below. $(document)

jquery functions inside of dynamically generated html not working [duplicate]

怎甘沉沦 提交于 2021-02-08 10:30:13
问题 This question already has answers here : Event binding on dynamically created elements? (23 answers) Closed 5 years ago . I looked up the load method to find an alternative to php includes. I got the load to add html dynamically and it works. The one issue though is that function aren't working. I think it's either an order issue, structure issue or plain logic. Any help to get my functions to work in dynamically generated html would be greatly appreciated. Sample structure below. $(document)

disable RequiredFieldvalidator

爱⌒轻易说出口 提交于 2021-02-08 10:27:22
问题 I have RequiredFieldvalidator and I want in certain cases to disable it. this is the RequiredFieldvalidator: <asp:RequiredFieldValidator ID="RfvHul" runat="server" ErrorMessage="Error" ControlToValidate="txtBox" Display="None"></asp:RequiredFieldValidator> and I've tried to do this but all these lines of code gave me Page_IsValid = false $("#RfvHul").attr("disabled", true); ValidatorEnable(document.getElementById("<%=RfvHul.ClientID%>"), false); document.getElementById("RfvHul").Enabled =

jQuery + PHP Autocomplete

和自甴很熟 提交于 2021-02-08 10:25:00
问题 I recently upgraded jQuery from 1.8.x to 1.11.3 because of another dependency, and my autocomplete is now broken. I've been searching this site, Google, etc.. all day and cannot come up with the answer. jQuery-UI version is 1.9.2. To start, I have a PHP file (autocomplete.php) that queries a MySQL database and returns inventory information: <?php require_once 'database.php'; if ($stmt = $con->prepare("select item_no, item_desc_1, item_desc_2 FROM items")) { $stmt->execute(); $name = array();

How to call included php file with AJAX?

那年仲夏 提交于 2021-02-08 10:24:44
问题 I am not sure if this is best approach, but how to make AJAX call with included file? Let me make working simple example. I have, main index.php file, with following content, where I want to access all data returned from included file where magic happens. Data is array type in reality. <?php require_once('magic.php'); ?> <html> <body> <form action="<?=$_SERVER['PHP_SELF'];?>" method="POST"> <input type="text" name="variable" id="variable" /> <input type="submit" value="Do magic" name="submit"

disable RequiredFieldvalidator

送分小仙女□ 提交于 2021-02-08 10:24:43
问题 I have RequiredFieldvalidator and I want in certain cases to disable it. this is the RequiredFieldvalidator: <asp:RequiredFieldValidator ID="RfvHul" runat="server" ErrorMessage="Error" ControlToValidate="txtBox" Display="None"></asp:RequiredFieldValidator> and I've tried to do this but all these lines of code gave me Page_IsValid = false $("#RfvHul").attr("disabled", true); ValidatorEnable(document.getElementById("<%=RfvHul.ClientID%>"), false); document.getElementById("RfvHul").Enabled =

taking the id value

Deadly 提交于 2021-02-08 10:20:32
问题 I want to get the id value of the content below? <form id="mainForm" name="mainForm"> <input type="radio" id="4" name="rads" value="1" checked> <input type="radio" id="3" name="rads" value="2" /> <input type="radio" id="2" name="rads" value="3" /> <input type="radio" id="1" name="rads" value="4" /> </form> <span id="result"></span> <span id="test"></span> <script> document.mainForm.onclick = function(){ var radVal = document.mainForm.rads.value; var idVal = document.getElementsById('id');