Search Results

Search found 5 results on 1 pages for 'ktsixit'.

Page 1/1 | 1 

  • Apply jquery selectbox style on chained selectbox

    - by ktsixit
    Hi all, I have created a pair of chained selectboxes in my page. The second selectbox is filled with a set of values, depending on the first box's selected value. The script that makes the two selectboxes work like this, uses php and javascript. This is the code I'm using: form <select name="continent" tabindex="1" onChange="getCountry(this.value)"> <option value="#">-Select-</option> <option value="Europe">Europe</option> <option value="Asia">Asia</option> </select> <div id="countrydiv"> <select name="country" tabindex="2"> <option></option> </select> </div> <input type="submit" /> </form> javascript code $(document).ready(function() { $('select[name="continent"]').selectbox({debug: true}); $('select[name="country"]').selectbox({debug: true}); }); function getXMLHTTP() { //fuction to return the xml http object var xmlhttp=false; try{ xmlhttp=new XMLHttpRequest(); } catch(e) { try{ xmlhttp= new ActiveXObject("Microsoft.XMLHTTP"); } catch(e){ try{ xmlhttp = new ActiveXObject("Msxml2.XMLHTTP"); } catch(e1){ xmlhttp=false; } } } return xmlhttp; } function getCountry(continentId) { var strURL="findCountry.php?continent="+continentId; var req = getXMLHTTP(); if (req) { req.onreadystatechange = function() { if (req.readyState == 4) { // only if "OK" if (req.status == 200) { document.getElementById('countrydiv').innerHTML=req.responseText; } else { alert("There was a problem while using XMLHTTP:\n" + req.statusText); } } } req.open("GET", strURL, true); req.send(null); } } php code (findCountry.php) <? $continent=intval($_GET['continent']); if ($_GET['continent'] == 'Europe') { ?> <select name="country"> <option value="France">France</option> <option value="Germany">Germany</option> <option value="Spain">Spain</option> <option value="Italy">Italy</option> </select> <? } if ($_GET['continent'] == 'Asia') { ?> <select name="country"> <option value="China">China</option> <option value="India">India</option> <option value="Japan">Japan</option> </select> <? } ?> What I want to do is to apply jquery selectbox styling on these selectboxes. I haven't succeeded in doing that yet. The problem is that jquery is hiding the normal selectbox and is replacing it with a list. Furthermore, after selectbox's content is refreshed, jquery cannot re-construct it into a list. You can take a look of the jquery code here Is there something I can do to combine these techniques? I have tried a million things but nothing worked. Can you please help me?

    Read the article

  • Apply jump menu functionality on select box styled with jquery

    - by ktsixit
    Hi all, I am using this script to apply style on a select box. It works fine as a standalone version. But I also need to apply a jump menu functionality on this select box. I tried adding a function but it seems that there is some conflict between the two scripts. The jquery styling and the jump menu function can't work together at the same time. Can you help me fix it? This is a sample code to let you know what I'm dealing with here: <script type="text/javascript"> $(document).ready(function() { $('#jumpMenu').selectbox({debug: true}); function MM_jumpMenu(targ,selObj,restore){ //v3.0 eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'"); if (restore) selObj.selectedIndex=0; } }); </script> <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)"> <option value="http://www.link1.com">link1</option> <option value="http://www.link2.com">link2</option> <option value="http://www.link3.com">link3</option> </select>

    Read the article

  • Display sql results in groups

    - by ktsixit
    Hi all, I have an sql query here and it returns a number of results. I'd like to show these results in groups. What I mean is, show the first 20 results in some part of the page, show the next 20 results in another part of the page etc... How can I do that?

    Read the article

  • Attach file to mail using php

    - by ktsixit
    Hi all, I've created a form which contains an upload field file and some other text fields. I'm using php to send the form's data via email and attach the file. This is the code I'm using but it's not working properly. The file is normally attached to the message but the rest of the data is not sent. $body="bla bla bla"; $attachment = $_FILES['cv']['tmp_name']; $attachment_name = $_FILES['cv']['name']; if (is_uploaded_file($attachment)) { $fp = fopen($attachment, "rb"); $data = fread($fp, filesize($attachment)); $data = chunk_split(base64_encode($data)); fclose($fp); } $headers = "From: $email<$email>\n"; $headers .= "Reply-To: <$email>\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; $headers .= "X-Sender: $first_name $family_name<$email>\n"; $headers .= "X-Mailer: PHP4\n"; $headers .= "X-Priority: 3\n"; $headers .= "Return-Path: <$email>\n"; $headers .= "This is a multi-part message in MIME format.\n"; $headers .= "------=MIME_BOUNDRY_main_message \n"; $headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; $message = "------=MIME_BOUNDRY_message_parts\n"; $message .= "Content-Type: text/html; charset=\"utf-8\"\n"; $message .= "Content-Transfer-Encoding: quoted-printable\n"; $message .= "\n"; $message .= "$body\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/octet-stream;\n\tname=\"" . $attachment_name . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $attachment_name . "\"\n\n"; $message .= $data; //The base64 encoded message $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message--\n"; $subject = 'bla bla bla'; $to="[email protected]"; mail($to,$subject,$message,$headers); Why isn't the $body data not sent? Can you help me fix it?

    Read the article

  • Limit asp:Repeater control - Is it possible without changing sql statement?

    - by ktsixit
    Hi all, I'm trying to apply some kind of limit on an asp:Repeater control, so that I can get only the first 5 results from repeating. The only suggested solution I have found is about limiting the sql statement results. In my case, this is not possible. I need to find some other kind of solution. Are there any other asp controls that I could use which are similar to Repeater? This is the current code I'm using: <asp:Repeater ID="rptrMan" runat="server" OnItemDataBound="rptrMan_ItemDataBound" EnableViewState="false"> <HeaderTemplate> <ul> </HeaderTemplate> <ItemTemplate> <li> <div class="picture1"> <asp:HyperLink ID="imageLink" runat="server" /> </div> <div class="title"> <asp:HyperLink ID="manTitle" runat="server" /> </div> </li> </ItemTemplate> <FooterTemplate> </ul> </FooterTemplate> </asp:Repeater>

    Read the article

1