Search Results

Search found 3143 results on 126 pages for 'br'.

Page 7/126 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • http request to cgi python script successful, but the script doesn't seem to run

    - by chipChocolate.py
    I have configured cgi scripts for my apache2 web server. Here is what I want to do: Client uploads the image to the server. (this already works) On success, I want to execute the python script to resize the image. I tried the following and the success function does execute but my python script does not seem to execute: Javascript code that sends the request: var input = document.getElementById('imageLoader'); imageName = input.value; var file = input.files[0]; if(file != undefined){ formData= new FormData(); console.log(formData.length); if(!!file.type.match(/image.*/)){ formData.append("image", file); $.ajax({ url: "upload.php", type: "POST", processData: false, contentType: false, success: function() { var input = document.getElementById('imageLoader'); imageName = input.value; var file = input.files[0]; formData = new FormData(); formData.append("filename", file); $.ajax({ url: "http://localhost/Main/cgi-bin/resize.py", type: "POST", data: formData, processData: false, contentType: false, success: function(data) { console.log(data); } }); // code continues... resize.py: #!/usr/bin/python import cgi import cgitb import Image cgitb.enable() data = cgi.FieldStorage() filename = data.getvalue("filename") im = Image.open("../JS/upload/" + filename) (width, height) = im.size maxWidth = 600 maxHeight = 400 if width > maxWidth: d = float(width) / maxWidth height = int(height / d) width = maxWidth if height > maxHeight: d = float(height) / maxHeight width = int(width / d) height = maxHeight size = (width, height) im = im.resize(size, Image.ANTIALIAS) im.save("../JS/upload/" + filename, quality=100) This is the apache2.conf: <Directory /var/www/html/Main/cgi-bin> AllowOverride None Options +ExecCGI SetHandler cgi-script AddHandler cgi-script .py .cgi Order allow,deny Allow from all </Directory> cgi-bin and python script file permissions: drwxrwxr-x 2 mou mou 4096 Aug 24 03:28 cgi-bin -rwxrwxrwx 1 mou mou 1673 Aug 24 03:28 resize.py Edit: Executing this code $.ajax({ url: "http://localhost/Main/cgi-bin/resize.py", type: "POST", data: formData, // formData = {"filename" : "the filename which was saved in a variable whie the image was uploaded"} processData: false, contentType: false, success: function(data) { alert(data); } }); it alerts the following: <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> <body bgcolor="#f0f0f8"><font color="#f0f0f8" size="-5"> --> --> </font> </font> </font> </script> </object> </blockquote> </pre> </table> </table> </table> </table> </table> </font> </font> </font><body bgcolor="#f0f0f8"> <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> <tr bgcolor="#6622aa"> <td valign=bottom>&nbsp;<br> <font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong>&lt;type 'exceptions.TypeError'&gt;</strong></big></big></font></td ><td align=right valign=bottom ><font color="#ffffff" face="helvetica, arial">Python 2.7.6: /usr/bin/python<br>Sun Aug 24 17:24:15 2014</font></td></tr></table> <p>A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.</p> <table width="100%" cellspacing=0 cellpadding=0 border=0> <tr><td bgcolor="#d8bbff"><big>&nbsp;</big><a href="file:///var/www/html/Main/cgi-bin/resize.py">/var/www/html/Main/cgi-bin/resize.py</a> in <strong><module></strong>()</td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;&nbsp;&nbsp;10</small>&nbsp;<br> </tt></font></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;&nbsp;&nbsp;11</small>&nbsp;filename&nbsp;=&nbsp;data.getvalue("filename")<br> </tt></font></td></tr> <tr><td bgcolor="#ffccee"><tt>=&gt;<small>&nbsp;&nbsp;&nbsp;12</small>&nbsp;im&nbsp;=&nbsp;Image.open("../JS/upload/"&nbsp;+&nbsp;filename)<br> </tt></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;&nbsp;&nbsp;13</small>&nbsp;<br> </tt></font></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;&nbsp;&nbsp;14</small>&nbsp;(width,&nbsp;height)&nbsp;=&nbsp;im.size<br> </tt></font></td></tr> <tr><td><small><font color="#909090">im <em>undefined</em>, <strong>Image</strong>&nbsp;= &lt;module 'Image' from '/usr/lib/python2.7/dist-packages/PILcompat/Image.pyc'&gt;, Image.<strong>open</strong>&nbsp;= &lt;function open&gt;, <strong>filename</strong>&nbsp;= '<font color="#c040c0">\xff\xd8\xff\xe0\x00\x10</font>JFIF<font color="#c040c0">\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00</font>C<font color="#c040c0">\x00\x06\x04\x05\x06\x05\x04\x06\x06\x05\x06\x07\x07\x06\x08\n\x10\n\n\t\t\n\x14\x0e</font>...<font color="#c040c0">\x94\r\x17\x11</font>b<font color="#c040c0">\xcd\xdc\x1a\xfe\xf1\x05\x1b\x15\xd1</font>R<font color="#c040c0">\xce\xe9</font>*<font color="#c040c0">\xb5\x8e</font>b<font color="#c040c0">\x97\x82\x87</font>R<font color="#c040c0">\xf4\xaa</font>K<font color="#c040c0">\x83</font>6<font color="#c040c0">\xbf\xfb</font>0<font color="#c040c0">\xa0\xb6</font>8<font color="#c040c0">\xa9</font>C<font color="#c040c0">\x86\x8d\x96</font>n+E<font color="#c040c0">\xd3\x7f\x99\xff\xd9</font>'</font></small></td></tr></table> <table width="100%" cellspacing=0 cellpadding=0 border=0> <tr><td bgcolor="#d8bbff"><big>&nbsp;</big><a href="file:///usr/lib/python2.7/dist-packages/PIL/Image.py">/usr/lib/python2.7/dist-packages/PIL/Image.py</a> in <strong>open</strong>(fp='../JS/upload/<font color="#c040c0">\xff\xd8\xff\xe0\x00\x10</font>JFIF<font color="#c040c0">\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00</font>C<font color="#c040c0">\x00\x06\x04\x05\x06\x05\x04\x06\x06\x05\x06</font>...<font color="#c040c0">\x94\r\x17\x11</font>b<font color="#c040c0">\xcd\xdc\x1a\xfe\xf1\x05\x1b\x15\xd1</font>R<font color="#c040c0">\xce\xe9</font>*<font color="#c040c0">\xb5\x8e</font>b<font color="#c040c0">\x97\x82\x87</font>R<font color="#c040c0">\xf4\xaa</font>K<font color="#c040c0">\x83</font>6<font color="#c040c0">\xbf\xfb</font>0<font color="#c040c0">\xa0\xb6</font>8<font color="#c040c0">\xa9</font>C<font color="#c040c0">\x86\x8d\x96</font>n+E<font color="#c040c0">\xd3\x7f\x99\xff\xd9</font>', mode='r')</td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;1994</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;isPath(fp):<br> </tt></font></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;1995</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename&nbsp;=&nbsp;fp<br> </tt></font></td></tr> <tr><td bgcolor="#ffccee"><tt>=&gt;<small>&nbsp;1996</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fp&nbsp;=&nbsp;builtins.open(fp,&nbsp;"rb")<br> </tt></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;1997</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else:<br> </tt></font></td></tr> <tr><td><font color="#909090"><tt>&nbsp;&nbsp;<small>&nbsp;1998</small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;filename&nbsp;=&nbsp;""<br> </tt></font></td></tr> <tr><td><small><font color="#909090"><strong>fp</strong>&nbsp;= '../JS/upload/<font color="#c040c0">\xff\xd8\xff\xe0\x00\x10</font>JFIF<font color="#c040c0">\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00</font>C<font color="#c040c0">\x00\x06\x04\x05\x06\x05\x04\x06\x06\x05\x06</font>...<font color="#c040c0">\x94\r\x17\x11</font>b<font color="#c040c0">\xcd\xdc\x1a\xfe\xf1\x05\x1b\x15\xd1</font>R<font color="#c040c0">\xce\xe9</font>*<font color="#c040c0">\xb5\x8e</font>b<font color="#c040c0">\x97\x82\x87</font>R<font color="#c040c0">\xf4\xaa</font>K<font color="#c040c0">\x83</font>6<font color="#c040c0">\xbf\xfb</font>0<font color="#c040c0">\xa0\xb6</font>8<font color="#c040c0">\xa9</font>C<font color="#c040c0">\x86\x8d\x96</font>n+E<font color="#c040c0">\xd3\x7f\x99\xff\xd9</font>', <em>global</em> <strong>builtins</strong>&nbsp;= &lt;module '__builtin__' (built-in)&gt;, builtins.<strong>open</strong>&nbsp;= &lt;built-in function open&gt;</font></small></td></tr></table><p><strong>&lt;type 'exceptions.TypeError'&gt;</strong>: file() argument 1 must be encoded string without NULL bytes, not str <br><tt><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</small>&nbsp;</tt>args&nbsp;= ('file() argument 1 must be encoded string without NULL bytes, not str',) <br><tt><small>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</small>&nbsp;</tt>message&nbsp;= 'file() argument 1 must be encoded string without NULL bytes, not str' <!-- The above is a description of an error in a Python program, formatted for a Web browser because the 'cgitb' module was enabled. In case you are not reading this in a Web browser, here is the original traceback: Traceback (most recent call last): File "/var/www/html/Main/cgi-bin/resize.py", line 12, in &lt;module&gt; im = Image.open("../JS/upload/" + filename) File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1996, in open fp = builtins.open(fp, "rb") TypeError: file() argument 1 must be encoded string without NULL bytes, not str --> Does this mean that the formData I am sending over is empty?

    Read the article

  • nginx - redirection doesn't work as expected

    - by Luis
    I have a domain listening on both http and https. I want to redirect all the traffic to https except for two specific locations. It works, but only for mydomain.com, not for www.mydomain.com. Here the config: upstream mydomain_rails { server unix:/home/deploy/mydomain/shared/pids/unicorn.sock; } # blog.mydomain.com server { listen 80; server_name blog.mydomain.com; rewrite ^ http://www.mydomain.com/de/blog permanent; } # blog.mydomain.com.br server { listen 80; server_name blog.mydomain.com.br; rewrite ^ http://www.mydomain.com/br/blog permanent; } # www.mydomain.de server { listen 80; server_name mydomain.de www.mydomain.de; rewrite ^ https://www.mydomain.com/de permanent; } # www.mydomain.com.br server { listen 80; server_name mydomain.com.br www.mydomain.com.br; rewrite ^ https://www.mydomain.com/br permanent; } server { listen 80; server_name mydomain.com; rewrite ^ http://www.mydomain.com$request_uri permanent; } ## www.mydomain.com ## Redirect http to https, keep blogs on plain http server { listen 80; server_name www.mydomain.com; location / { # if ($host ~* ^(www\.mydomain\.com)$ ) { rewrite ^/(.*)$ https://www.mydomain.com/$1 permanent; # } # return 444; } # Matches any request starting with '/br/blog' and proxies to the upstream blog instance location ~* /br/blog { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { rewrite ^/br/blog$ /; rewrite ^/br/blog/(.*)$ /$1; proxy_pass http://mydomain_blog_br; break; } } # Matches any request starting with '/de/blog' and proxies to the upstream blog instance location ~* /de/blog { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { rewrite ^/de/blog$ /; rewrite ^/de/blog/(.*)$ /$1; proxy_pass http://mydomain_blog; break; } } } # www.mydomain.com server { add_header Cache-Control "public, must-revalidate"; server_name mydomain.com www.mydomain.com; listen 443; ssl on; ssl_certificate /etc/ssl/mydomain.com/sslchain.crt; ssl_certificate_key /etc/ssl/mydomain.com/privatekey.key; ## Strict Transport Security (ForceHTTPS), max-age 30d add_header Strict-Transport-Security "max-age=2592000; includeSubdomains"; ## Due SSL encryption, rather to increase the keepalive requests and timeout keepalive_requests 10; keepalive_timeout 60 60; root /home/deploy/mydomain/current/public/; error_log /home/deploy/mydomain/shared/log/nginx.error.log info; access_log /home/deploy/mydomain/shared/log/nginx.access.log main; ## Redirect from non-www to www if ($host = 'mydomain.com' ) { rewrite ^/(.*)$ https://www.mydomain.com/$1 permanent; } ## Caching images for 3 months location ~* \.(ico|css|js|gif|jpe?g|png)\?[0-9]+$ { expires 30d; break; } ## Deny illegal Host headers if ($host !~* ^(mydomain.com|www.mydomain.com)$ ) { return 444; } ## Deny certain User-Agents (case insensitive) if ($http_user_agent ~* (Baiduspider|webalta|Wget|WordPress|youdao|jakarta) ) { return 444; } ## Deny certain Referers (case insensitive) if ($http_referer ~* (dating|diamond|forsale|girl|jewelry|nudit|poker|porn|poweroversoftware|sex|teen|webcam|zippo|zongdo) ) { return 444; } ## Enable maintenance page. The page is copied in during capistrano deployment set $maintenance 0; if (-f $document_root/index.html) { set $maintenance 1; } if ($request_uri ~* (jpg|jpeg|gif|png|js|css)$) { set $maintenance 0; } if ($maintenance) { rewrite ^(.*)$ /index.html last; break; } location /uk { auth_basic "Restricted"; auth_basic_user_file /etc/nginx/htpasswd; root /home/deploy/mydomain/current/public/; try_files $uri @fallback; } # Matches any request starting with '/br/blog' and proxies to the upstream blog instance location ^~ /br/blog { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { rewrite ^/br/blog$ /; rewrite ^/br/blog/(.*)$ /$1; proxy_pass http://mydomain_blog_br; break; } } # Matches any request starting with '/de/blog' and proxies to the upstream blog instance location ^~ /de/blog { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; if (!-f $request_filename) { rewrite ^/de/blog$ /; rewrite ^/de/blog/(.*)$ /$1; proxy_pass http://mydomain_blog; break; }} # Matches any request starting with '/lp' and proxies to the upstream blog instance location /lp { proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; rewrite ^/lp(/?.*)$ /$1; proxy_pass http://mydomain_landingpage; break; } #Matches any request, and looks for static files before reverse proxying to the upstream app server socket location / { root /home/deploy/mydomain/current/public/; try_files $uri @fallback; } # Called after the above pattern, if no static file is found location @fallback { proxy_set_header X-Sendfile-Type X-Accel-Redirect; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_redirect off; proxy_pass http://mydomain_rails; } ## All other errors get the generic error page error_page 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 495 496 497 500 501 502 503 504 505 506 507 /500.html; location /500.html { root /home/deploy/mydomain/current/public/; } } I defined the blog upstream. As said, it works properly for mydomain.com, but not for www.mydomain.com. Any idea?

    Read the article

  • Validating textboxes and checkboxes then add the values of those checkboxes

    - by TiTi Nguyen
    I am very new to Javascript. I am running to a problem and don't know how to solve it. Could you please help? Basically, I want to create some textboxes and checkboxes in a form. Then I have to validate those fields, and add the values of the checkboxes if they are selected. One of the textboxes asking for how many semesters attended, and 3 checkboxes with value of 100, 1000, and 750. Whichever checkbox is selected, it should multiply its value to the number of semesters attended. For example if the first two checkboxes are selected then totalCost = (100+1000)* semester. Here is my code: User Name: <label>User Address: <input type = "text" id ="address" size = "30"/></label> <br/><br/> <label> User E-mail address: <input type = "text" id ="email" size = "30"/></label> <br/><br/> <label> User Phone number: <input type = "text" id ="phone" size = "30"/></label> <br/><br/> <label> User area code: <input type = "text" id ="area" size = "30"/></label> <br/><br/> <label> User SSN: <input type = "text" id ="ssn" size = "30"/></label> <br/><br/> <label> User Birthday: <input type = "text" id ="birthday" size = "30"/></label> <br/><br/> <label> Number of semester attended: <input type = "text" id ="semester" size = "3"/></label> <br/><br/> <label><input type="checkbox" id="box_book" value="100"/>Books $100 per semester</label> <br/> <label><input type="checkbox" id="box_tuition" value="1000"/>Tuition $1000 per semester</label> <br/> <label><input type="checkbox" id="box_room" value="750"/>Room and Board $750 per semester</label> <br/> <input type="reset" id="reset"/> <input type="submit" id="submit" onclick="checking()"/> <p/> </form> function checking() { var name=document.forms["myForm"]["name"].value; var address=document.forms["myForm"]["address"].value; var email=document.forms["myForm"]["email"].value; var atpos=email.indexOf("@"); var dotpos=email.lastIndexOf("."); var phone=document.forms["myForm"]["phone"].value; var area=document.forms["myForm"]["area"].value; var ssn=document.forms["myForm"]["ssn"].value; var birth=document.forms["myForm"]["birthday"].value; var semester=document.forms["myForm"]["semester"].value; var boxBook = document.forms["myForm"]["box_book"].value; var boxTuition = document.forms["myForm"]["box_tuition"].value; var boxRoom = document.forms["myForm"]["box_room"].value; if (name==null || name=="") { alert("Please fill in your name."); return false; } if (address==null || address=="") { alert("Please fill in your address."); return false; } if (atpos<1 || dotpos<atpos+2 || dotpos+2>=email.length) { alert("The email (" + email + ") is not a valid e-mail address. Please reenter your email address."); return false; } if(phone.length!=10) { alert("Phone number entered in incorrect form. Please reenter phone number in the correct form which contains 10 numbers."); return false; } if (area==null || area=="") { alert("Please fill in the area code"); return false; } if(ssn.length!=9) { alert("SSN entered in incorrect form. Please reenter SSN."); return false; } if (birth==null || birth=="") { alert("Please fill in your date of birth."); return false; } if (semester==null || semester=="") { alert("How many semester have you attended?"); return false; } if (document.getElementById("box_book").checked == false && document.getElementById("box_tuition").checked == false && document.getElementById("box_room").checked == false) { alert("You must select one of the checkboxes"); return false; } if (document.getElementById("box_book").checked ==true) { var subcost = boxBook; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_book").checked == true && document.getElementById("box_tuition").checked == true) { var subcost = boxBook + boxTuition; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_book").checked == true && document.getElementById("box_tuition").checked == true && document.getElementById("box_room").checked == true) { var subcost = boxBook + boxTuition + boxRoom; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_tuition").checked ==true) { var subcost = boxTuition; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_tuition").checked == true && document.getElementById("box_room").checked == true) { var subcost = boxTuition + boxRoom; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_room").checked ==true) { var subcost = boxRoom; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } if (document.getElementById("box_book").checked == true && document.getElementById("box_room").checked == true) { var subcost = boxBook + boxRoom; var totalcost = subcost * semester; alert ("Your total cost is: $" + totalcost); } else return false; } When I hit the submit button, nothing happens!! Please help.

    Read the article

  • JQuery form sticks with the ajax indicator on and won't submit

    - by Steven Buick
    Hi, I'm using JQuery 1.3 to validate and submit a form to a PHP page which JSON encodes a server response to display on the original form page. I've tried submitting the form without the JQuery part and everything seems to work fine but when I add JQuery it doesn't submit and constantly displays the ajax indicator. Here's my code: $(document).ready(function(){ var options = { target: '#messagebox', url: 'updateregistration.php', type:'POST', beforeSubmit: validatePassword, success: processJson, dataType: 'json' }; $("form:not(.filter) :input:visible:enabled:first").focus(); $("#webmailForm").validate({ errorLabelContainer: "#messagebox", rules: { forename: "required", surname: "required", currentpassword: "required", directemail: { required: true, email: true }, directtelephone: "required" }, messages: { forename: { required: "Please enter your forename" }, directemail: { required: "Please enter your direct e-mail address", email: "Your e-mail address does not appear to be valid(Example: [email protected])" }, surname: { required: "Please enter your surname" }, directtelephone: { required: "Please enter your direct telephone number" }, currentpassword: { required: "Please enter your current password" } } }); $('#webmailForm').submit(function() { $('#ajaxindicator').show(); $(this).ajaxSubmit(options); return false; }); }); function processJson(data) { $("#webmailForm").fadeOut("fast"); $("#messagebox").fadeIn("fast"); $("#messagebox").css({'background-image' : 'url(../images/messageboxbackgroundgreen.png)','border-color':'#009900','border-width':'1px','border-style':'solid'}); var forename=data.forename; var surname=data.surname; var directemail=data.directemail; var directphone=data.directphone; var dateofbirth=data.dateofbirth; var companyname=data.companyname; var fulladdress=data.fulladdress; var telephone=data.telephone; var fax=data.fax; var email=data.email; var website=data.website; var fsanumber=data.fsanumber; var membertype=data.membertype; var network=data.network; $("#messagebox").html('<h3>Registration Update successful!</h3>' + '<p><strong>Member Type:</strong> ' + membertype + '<br>' + '<strong>Forename:</strong> ' + forename + '<br><strong>Surname:</strong> ' + surname + '<br><strong>Direct E-mail:</strong> ' + directemail + '<br><strong>Direct Phone:</strong> ' + directphone + '<br><strong>Date of Birth:</strong> ' + dateofbirth + '<br><strong>Company:</strong> ' + companyname + '<br><strong>Address:</strong> ' + fulladdress + '<br><strong>Telephone:</strong> ' + telephone + '<br><strong>Fax:</strong> ' + fax + '<br><strong>E-mail:</strong> ' + email + '<br><strong>Website:</strong> ' + website + '<br><strong>FSA Number:</strong> ' + fsanumber + '<br><strong>Network:</strong> ' + network + '</p>'); $('#ajaxindicator').hide(); } function validatePassword(){ var clientpassword=$("#clientpassword").val(); var currentpassword=$("#currentpassword").val(); var currentpasswordmd5=hex_md5(currentpassword); if (currentpasswordmd5!=clientpassword){ $("#messagebox").html("You input the wrong current password, please try again."); $('#ajaxindicator').hide(); return false; } } I have a disabled textbox and some hidden ones. Could this be the problem?

    Read the article

  • Inserting THEAD element into embedded HTML using jQuery

    - by robalot
    I'm trying to use jQuery to insert HTML into a table element. I've been messing variations of the selector (below) with no luck. Can someone help me? My Selector: $j('#ctl00_body_gridData_dom').children('table:first').append("<thead><tr><td colspan='6'>&nbsp;</td><td align='center' colspan='7'>EM SPECS</td><td align='center' colspan='7'>FISH</td><td colspan='11'>&nbsp;</td></tr></thead>"); Here's what I am trying to do... I want to insert this: <thead> <tr> <td colspan="6"> &nbsp; </td> <td align="center" colspan="7"> EM SPECS </td> <td align="center" colspan="7"> FISH </td> <td colspan="11"> &nbsp; </td> </tr> </thead> The sample below is what I want the end result to look like... So It Looks Like This: Jquery Event Pool <table id="ctl00_body_gridData" style="width: 2000px; -moz-user-select: none;" border="1" cellpadding="0" cellspacing="0"> <tbody> <tr> <td id="ctl00_body_gridData_dom" class="GridData" style="vertical-align: top; height: 245px;" valign="top"> <table style="width: 100%;" border="0" cellpadding="0" cellspacing="0"> <thead> <tr> <td colspan="6"> &nbsp; </td> <td align="center" colspan="7"> EM SPECS </td> <td align="center" colspan="7"> FISH </td> <td colspan="11"> &nbsp; </td> </tr> </thead> <tbody> <tr id="ctl00_body_gridData_top_head" class="headerlineGrid"> <td width="16"> <div style="width: 16px;"></div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,4,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,4,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,0,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,4,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,4,0)" style="width: 89px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 89px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Work<br>Package</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,6,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,6,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,1,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,6,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,6,0)" style="width: 62px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 62px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Work<br>Order</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,9,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,9,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,2,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,9,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,9,0)" style="width: 66px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 66px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> FCR<br>Group</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,12,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,12,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,3,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,12,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,12,0)" style="width: 105px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 105px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center">Contractor</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,15,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,15,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,4,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,15,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,15,0)" style="width: 159px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 159px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Capital/Expense<br>Group</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,19,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,19,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,5,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,19,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,19,0)" style="width: 99px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 99px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center">Cost Type</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,20,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,20,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,6,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,20,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,20,0)" style="width: 81px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 81px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Commit<br>Dollars</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,21,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,21,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,7,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,21,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,21,0)" style="width: 81px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 81px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Commit<br>Hours</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,22,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,22,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,8,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,22,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,22,0)" style="width: 86px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 86px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Commit<br>Quantity</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,23,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,23,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,9,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,23,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,23,0)" style="width: 76px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 76px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Control<br>Budget</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,24,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,24,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,10,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,24,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,24,0)" style="width: 46px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 46px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center">FTC</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,25,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,25,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,11,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,25,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,25,0)" style="width: 88px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 88px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Total<br>Forecast</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,26,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,26,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,12,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,26,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,26,0)" style="width: 50px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 50px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br>COB</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,27,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,27,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,13,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,27,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,27,0)" style="width: 49px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 49px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br>CCB</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,28,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,28,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,14,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,28,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,28,0)" style="width: 81px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 81px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br> Commit<br>$</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,29,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,29,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,15,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,29,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,29,0)" style="width: 81px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 81px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br> Commit<br>Hours</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,30,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,30,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,16,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,30,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,30,0)" style="width: 86px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 86px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br> Commit<br>Quantity</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,31,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,31,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,17,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,31,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,31,0)" style="width: 95px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 95px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Ctr<br>% Compl.</td> </tr> </tbody> </table> </div> </td> <td onclick="ctl00_body_gridData.ClickHandler(event,this,32,0)" ondblclick="ctl00_body_gridData.DblClickHandler(event,null,32,0)" onmousemove="ctl00_body_gridData.MoveHandler(event,this,18,0)" onmouseover="ctl00_body_gridData.OverHandler(event,this,0)" onmouseout="ctl00_body_gridData.OutHandler(event,this,0)" onmousedown="ctl00_body_gridData.DownHandler(event,this,32,0)" onmouseup="ctl00_body_gridData.UpHandler(event,this,32,0)" style="width: 105px;" class="HeadingCell" align="center"> <div style="text-align: center; overflow: hidden; width: 105px;"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tbody> <tr> <td style="white-space: nowrap; text-align: center;" class="HeadingCellText" align="center"> Contractor<br>CFTC</td> </tr> </tbody> </table> </div> </td> </tr> <tr> <td id="ctl00_body_gridData_expcolgrp_0" width="16" align="center"></td> <td class="GroupHeading" colspan="20"> FCR<br>Group: Engineering</td> </tr> <tr> <td id="ctl00_body_gridData_expcolgrp_1" width="16" align="center"></td> <td class="GroupHeading" colspan="20"> FCR<br>Group: Pipe</td> </tr> <tr> <td id="ctl00_body_gridData_expcolgrp_2" width="16" align="center"></td> <td class="GroupHeading" colspan="20"> FCR<br>Group: Concrete</td> </tr> <tr> <td id="ctl00_body_gridData_expcolgrp_3" width="16" align="center"></td> <td class="GroupHeading" colspan="20"> FCR<br>Group: Insulation</td> </tr> <tr> <td id="ctl00_body_gridData_expcolgrp_4" width="16" align="center"></td> <td class="GroupHeading" colspan="20"> FCR<br>Group: Buildings</td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </body> </html>

    Read the article

  • vb.net .aspxauth

    - by Morgan
    I am working with a large site trying to implement web parts for particular users in a particular subdirectory but I can't get the .ASPXAUTH cookie to be recognized. I've read dozens of tutorials and MS class library pages that tell me how it should work to no avail. I am brand new to Web parts, so I'm sorry if I'm unclear. The idea is that logged in users can travel the site, but then when they go to their dashboard, they are programmatically authenticated using Membership and FormsAuthentication to pull up their Personalization. When I step through the code, I can see the cookie being set, and that it exists on the following page, but Membership.GetUser() and User.Identity are both empty. I know the user exists because I created it programmatically using Membership.CreateUser() and I can see it when I do Membership.GetAllUsers() and it's online when i use Membership.GetUser(username) but the Personalization doesn't work. Right now, I'm just trying to get the proof of concept going. I've tried creating the ticket and cookie myself, and also using SetAuthCookie() (code follows). I really just need a clue as to what to look for. Here's the "login" page... If Membership.ValidateUser(testusername, testpassword) Then -- Works FormsAuthentication.SetAuthCookie(testusername, true) Response.Redirect("webpartsdemo1.aspx", False) End If And the next page (webpartsdemo1.aspx) Dim cookey As String = ".ASPXAUTH" lblContent.Text &= "<br><br>" & Request.Cookies(cookey).Name & " Details" lblContent.Text &= "<br>path = " & Request.Cookies(cookey).Path lblContent.Text &= "<br>domain = " & Request.Cookies(cookey).Domain lblContent.Text &= "<br>expires = " & Request.Cookies(cookey).Expires lblContent.Text &= "<br>Secure only? " & Request.Cookies(cookey).Secure lblContent.Text &= "<br>HTTP only? = " & Request.Cookies(cookey).HttpOnly lblContent.Text &= "<br>Has subkeys? " & Request.Cookies(cookey).HasKeys lblContent.Text &= "<br/><br/>request authenticated? " & Request.IsAuthenticated.ToString lblContent.Text &= " Getting user<br/>Current User: " Dim muGidget As MembershipUser If Request.IsAuthenticated Then muGidget = Membership.GetUser lblContent.Text &= Membership.GetUser().UserName Else lblContent.Text &= "none found" End If Output: .ASPXAUTH Details path = / domain = expires = 12:00:00 AM Secure only? False HTTP only? = False Has subkeys? False request authenticated? False Getting user Current User: none found Sorry to go on so long. Thanks for any help you can provide.

    Read the article

  • Spacing differences between IE7 and Firefox/Opera/Chrome

    - by user306940
    I have an ongoing issue with the amount of vertical space of unordered lists in IE7 vs. Firefox/Chrome/Opera and I can't seem to find a solution out there. In IE7, the space is less and what I would like to see. In Firefox, Chrome, and Opera, the space between is about twice as much. I can't account for any of the spacing issues in my code or page. On my page, the code looks like this: <!--BEGIN SIDEBOX--> <div id="sidebox_new"> <div id="sidebox_top"><div id="sup">SUPPORT LINKS</div></div> <div id="sidebox_bod"> <br /> <ul> <li><a href="training.aspx">User Training</a></li><br /><br /> <li><a href="faqs.aspx">FAQ</a></li><br /><br /> <li><a href="logonasst.aspx">Logon Assist. Center</a></li><br /><br /> <li><a href="faxus.aspx">Fax Us</a></li><br /><br /> <li><a href="callus.aspx">Call Us</a></li><br /><br /> <li><a href="feedback.aspx">General Feedback</a></li> </ul> </div> <div id="sidebox_btm"></div> </div> <!--END SIDEBOX--> My CSS for this section looks like this: #sidebox_bod { width: 200px; margin: 0 30px 0 0; padding: 0; background: url('../img/supbxbod.gif'); background-repeat:repeat-y; background-position:bottom; } #sidebox_bod ul { list-style-image:url('../triangle.gif'); text-align:left; padding: 0 0 0 30px; margin: 0; } #sidebox_bod ul li a { font-size: 13px; } Any idea what I can do to try to have the vertical spacing the same across all browsers? I would prefer to have the IE7 look to try to fix this. Thanks.

    Read the article

  • How to detect Links with out anchor element in a plain text

    - by dhee
    If user enters his text in the text box and saves it and again what's to add some more text he can edit that text and save it if required. Firstly if user enters that text with some links I, detected them and converted any hyperlinks to linkify in new tab. Secondly if user wants to add some more text and links he clicks on edit and add them and save it at this time I must ignore the links that already hyperlinked with anchor button Please help and advice For example: what = "<span>In the task system, is there a way to automatically have any site / page URL or image URL be hyperlinked in a new window?</span><br><br><span>So If I type or copy http://www.stackoverflow.com/&nbsp; for example anywhere in the description, in any of the internal messages or messages to clients, it automatically is a hyperlink in a new window.</span><br><a href="http://www.stackoverflow.com/">http://www.stackoverflow.com/</a><br> <br><span>Or if I input an image URL anywhere in support description, internal messages or messages to cleints, it automatically is a hyperlink in a new window:</span><br> <span>https://static.doubleclick.net/viewad/4327673/1-728x90.jpg</span><br><br><a href="https://static.doubleclick.net/viewad/4327673/1-728x90.jpg">https://static.doubleclick.net/viewad/4327673/1-728x90.jpg</a><br><br><br><span>This would save us a lot time in task building, reviewing and creating messages.</span> Test URL's http://www.stackoverflow.com/ http://stackoverflow.com/ https://stackoverflow.com/ www.stackoverflow.com //stackoverflow.com/ <a href='http://stackoverflow.com/'>http://stackoverflow.com/</a>"; I've tried this code function Linkify(what) { str = what; out = ""; url = ""; i = 0; do { url = str.match(/((https?:\/\/)?([a-z\-]+\.)*[\-\w]+(\.[a-z]{2,4})+(\/[\w\_\-\?\=\&\.]*)*(?![a-z]))/i); if(url!=null) { // get href value href = url[0]; if(href.substr(0,7)!="http://") href = "http://"+href; // where the match occured where = str.indexOf(url[0]); // add it to the output out += str.substr(0,where); // link it out += '<a href="'+href+'" target="_blank">'+url[0]+'</a>'; // prepare str for next round str = str.substr((where+url[0].length)); } else { out += str; str = ""; } } while(str.length>0); return out; } Please help Thanks.

    Read the article

  • On saving a new record an associated id changes to 9 figure number

    - by Dave
    Hi, I have a table of venues, with each venue belonging to an area and a type. I recently dropped the table and added to it some addressline fields. I have re-migrated it but now the area_id field saves as a random? 9 figure number. Both the area_id and venuetype_id integers are created in the same way from the create new form and the venuetype_id saves as normal but not the area_id. Can anyone offer any help? whats shown in the console => [#<Venue id: 4, name: "sdf", addressline1: "", addressline2: "", addressline3 : "", addressline4: "", icontoppx: 234, iconleftpx: 234, area_id: 946717224, ven uetype_id: 8, created_at: "2011-03-17", updated_at: "2011-03-17 23:33:53">] irb(main):030:0> the area_id should be 8 in the above example. The area and venuetype id's are slected from dropdown boxes on the new venue form. new form <%= form_for @venue do |f| %> <p>name: <br> <%= f.text_field :name %></p> <p>top: <br> <%= f.text_field :icontoppx %></p> <p>left: <br> <%= f.text_field :iconleftpx %></p> <p>addressline1: <br> <%= f.text_field :addressline1 %></p> <p>addressline2: <br> <%= f.text_field :addressline2 %></p> <p>addressline3: <br> <%= f.text_field :addressline3 %></p> <p>addressline4: <br> <%= f.text_field :addressline4 %></p> <p>area: <br> <%= f.collection_select(:area_id, Area.all, :id, :name) %></p> <p>venuetype: <br> <%= f.collection_select(:venuetype_id, Venuetype.all, :id, :name) %></p> <br><br> <div class="button"><%= submit_tag %></div> <% end %> Areas table class CreateAreas < ActiveRecord::Migration def self.up create_table :areas do |t| t.string :name t.timestamps end end def self.down drop_table :areas end end Thanks very much for any help!

    Read the article

  • Adding one subquery makes query a little slower, adding another makes it way slower

    - by Jason Swett
    This is fast: select ba.name, penamt.value penamt, #address_line4.value address_line4 from account a join customer c on a.customer_id = c.id join branch br on a.branch_id = br.id join bank ba on br.bank_id = ba.id join account_address aa on aa.account_id = a.id join address ad on aa.address_id = ad.id join state s on ad.state_id = s.id join import i on a.import_id = i.id join import_bundle ib on i.import_bundle_id = ib.id join (select * from unused where heading_label = 'PENAMT') penamt ON penamt.account_id = a.id #join (select * from unused where heading_label = 'Address Line 4') address_line4 ON address_line4.account_id = a.id where i.active=1 And this is fast: select ba.name, #penamt.value penamt, address_line4.value address_line4 from account a join customer c on a.customer_id = c.id join branch br on a.branch_id = br.id join bank ba on br.bank_id = ba.id join account_address aa on aa.account_id = a.id join address ad on aa.address_id = ad.id join state s on ad.state_id = s.id join import i on a.import_id = i.id join import_bundle ib on i.import_bundle_id = ib.id #join (select * from unused where heading_label = 'PENAMT') penamt ON penamt.account_id = a.id join (select * from unused where heading_label = 'Address Line 4') address_line4 ON address_line4.account_id = a.id where i.active=1 But this is slow: select ba.name, penamt.value penamt, address_line4.value address_line4 from account a join customer c on a.customer_id = c.id join branch br on a.branch_id = br.id join bank ba on br.bank_id = ba.id join account_address aa on aa.account_id = a.id join address ad on aa.address_id = ad.id join state s on ad.state_id = s.id join import i on a.import_id = i.id join import_bundle ib on i.import_bundle_id = ib.id join (select * from unused where heading_label = 'PENAMT') penamt ON penamt.account_id = a.id join (select * from unused where heading_label = 'Address Line 4') address_line4 ON address_line4.account_id = a.id where i.active=1 Why is it fast when I include just one of the two subqueries but slow when I include both? I would think it should be twice as slow when I include both, but it takes a really long time. On on MySQL.

    Read the article

  • How to get Tkinter to input text and submit with button

    - by Rob
    Hi I was wondering if anybody could help me submit code from the test fields to the login fields from Tkinter import * import tkMessageBox if ( __name__ == "__main__" ): import resources.lib.mechanize as mechanize mechanize # Start Browser br = mechanize.Browser(factory=mechanize.RobustFactory()) # User-Agent (Firefox) br.addheaders = [('User-agent', 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.6')] br.open('http://razetheworld.com/wp-login.php?redirect_to=http%3A%2F%2Frazetheworld.com') br.select_form(name="loginform") br['log'] = 'entryWidget_U must enter here' br['pwd'] = 'entryWidget_P must enter here' br.submit(name="wp-submit") print br.geturl() def displayText(): """ Display the Entry text value. """ global entryWidget_U global entryWidget_P if entryWidget_U.get().strip() == "": tkMessageBox.showerror("Tkinter Entry Widget", "Enter a Username") else: tkMessageBox.showinfo("Tkinter Entry Widget", "Text value =" + entryWidget_U.get().strip()) if entryWidget_P.get().strip() == "": tkMessageBox.showerror("Tkinter Entry Widget", "Enter a Password") else: tkMessageBox.showinfo("Tkinter Entry Widget", "Text value =" + entryWidget_P.get().strip()) if __name__ == "__main__": root = Tk() root.title("Tkinter Entry Widget") root["padx"] = 40 root["pady"] = 20 # Create a text frame to hold the text Label and the Entry widget textFrame_U = Frame(root) textFrame_P = Frame(root) #Create a Label in textFrame entryLabel = Label(textFrame_U) entryLabel["text"] = "Enter Username:" entryLabel.pack(side=LEFT) entryLabel = Label(textFrame_P) entryLabel["text"] = "Enter Password:" entryLabel.pack(side=LEFT) # Create an Entry Widget in textFrame entryWidget_U = Entry(textFrame_U) entryWidget_U["width"] = 50 entryWidget_U.pack(side=LEFT) entryWidget_P = Entry(textFrame_P) entryWidget_P["width"] = 50 entryWidget_P.pack(side=LEFT) textFrame_U.pack() textFrame_P.pack() button = Button(root, text="Login", command=#Run br.submit(name="wp-submit")) button.pack() root.mainloop()

    Read the article

  • Posting a form using Ajax

    - by hopes
    Hi everyone, do u have an idea of how to send my radio button name for myAjaxPostrequest.send(parameters); can parameters be like this: var answername=document.getElementById('option1').name; var parameters=answername; ? this code is for using ajax to post a form and my php page needs the name of the radiobutton clicked I tried this code and it works as I want except for inserting in the database. It means parameters is the problem what I want to insert is the number located between brakects of the radiobutton name. I could do it when I post form without Ajax but now I can't send the name of the radiobutton any clue about what I can send as parameter for function myAjaxPostrequest.send(parameters);? <form id="Question1" method="post"> <br /> <P> The sky color is.. </P><img border="0" src="images/wonder.png" width="94" height="134"/><br /><br /><br /> <input type="radio" id="option1" name="answer[1]" value="correct!" onclick="submitFormWithAjax();"/> blue <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> red <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> green <br /> <input type="radio" id="option1" name="answer[1]" value="false!" onclick="submitFormWithAjax();"/> white <br /> <br /> </Form>

    Read the article

  • Sed problem in a Bash script

    - by moata_u
    Hello there. I'm having a problem using the sed command . I'm trying to write a bash script that does the following : search for the line that contain :@ then save the line that contained :@ and replace it with new line as in the following: #! /bin/bash echo "Please enter the ip address of you file"<br> read ipnumber<br> find=`grep ':@' application.properties` # find the line<br> input="connection.url=jdbc\racle\:thin\:@$ipnumber\:1521\:billz" # preparing new line<br> echo `sed "s/'${find}'/'${input}'/g" application.properties` # replace old with new line <br> The problem is: nothing happens. I've already tried to use "${find}" instead of '${find}'

    Read the article

  • Php mail pulling form data from previous page

    - by Mark
    So I have a form being filled out on one php like so: <p> <label for="first_name">First Name: </label> <input type="text" size="30" name="first_name" id="first_name"/> </p> <p> <label for="last_name"> Last Name:</label> <input type="text" size="30" name="last_name" id="last_name"/> </p> <p> <label for="address_street">Street:</label> <input type="text" size="30" name="address_street" id="address_street"/> </p> <p> <label for="address_city">City:</label> <input type="text" size="30" name="address_city" id="address_city"/> </p> <p> <label for="address_state">State/Province:</label> <input type="text" size="30" name="address_state" id="address_state"/> </p> <p> <label for="email">Your e-mail: </label> <input type="text" size="30" name="email" id="email"/> </p> <p> <label for="phone">Your phone number: </label> <input type="text" size="30" name="phone" id="phone"/> </p> This is on one php page. From here, it goes to another php which part of it contains script to send a html email to recipient. Problem is, I cannot seem to get it to pull the variables even though I thought I declared them correctly and mixed them into the html correctly. <?php $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $to = "[email protected], [email protected]"; $subject = "HTML email for ALPS"; $message .= ' <html> <body> <div style="display: inline-block; width: 28%; float: left;"> <img src="http://englishintheusa.com/images/alps-logo.jpg" alt="ALPS Language School" /> </div> <div style="display: inline-block; width: 68%; float: right;"> <p style="color: #4F81BD; font-size: 20px; text-decoration: underline;">Thanks You For Your Inquiry!</p> </div> <div style="padding-left: 20px; color: #666666; font-size: 16.8px; clear: both;"> <p>Dear $first_name $last_name ,</p> </br > <p>Thank you for the following inquiry:</p> </br > </br > </br > </br > <p>****Comment goes here****</p> </br > </br > <p>We will contact you within 2 business days. Our office is open Monday-Friday, 8:30 AM - 5:00 PM Pacific Standard Time.</p> </br > <p>Thank you for your interest!</p> </br > </br > <p>Best Regards,</p> </br > </br > <p>ALPS Language School</p> </br > </br > <p>430 Broadway East</p> <p>Seattle WA 98102</p> <p>Phone: 206.720.6363</p> <p>Fax: 206. 720.1806</p> <p>Email: [email protected]</p> </div> </body> </html>'; // Always set content-type when sending HTML email $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers mail($to,$subject,$message,$headers); ?> So you see where I am trying to get first_name and last_name. Well it doesn't come out correctly. Can someone help here?

    Read the article

  • Prevent Carousel scroll within scrollable Container (Sencha 2)?

    - by TragedyStruck
    I've got a Container with a header, content (Carousel) and a footer. The Container itself is therefor scrollable (vertical) to be able to scroll down to the footer. The Carousel can be swiped horizontally to change active item. I want to lock it to do only two thing: If starting to move vertically, only scroll Container If starting to move horizontally, only scroll Carousel If you now grab the Carousel you are able to scroll both ways at the same time. Example code: Ext.define('MyApp.view.MyContainer', { extend: 'Ext.Container', config: { scrollable: true, items: [ { xtype: 'container', items: [ { xtype: 'label', html: 'abc' } ] }, { xtype: 'carousel', height: 200, scrollable: false, items: [ { xtype: 'label', html: 'x' }, { xtype: 'label', html: 'y<br/>y<br/>y<br/>y<br/>y<br/>y<br/>y<br/>y' } ] }, { xtype: 'container', items: [ { xtype: 'label', html: 'def' } ] } ] } }); Using Sencha Touch 2.

    Read the article

  • PHP Get random paragraph

    - by Jack
    Anyone know how to get a random set of lines from a text file? I want to get a set of 3 lines with <br> on the front of each and display them through html. example: set 1 <br>Hi <br>what's your name <br>goodbye set 2 <br>stack <br>overflow <br>hi there set 3,4,5.... Choose one random set and display it. The sets of lines would be stored in a text file. Thanks a lot!

    Read the article

  • Rails 3 Nested Forms

    - by Mike
    I have a Person model and an Address Model: class Person < ActiveRecord::Base has_one :address accepts_nested_attributes_for :address end class Address < ActiveRecord::Base belongs_to :person end In my people controller I have @person.build_address in my new action. My forms builds correctly. The problem is that when I submit the form, a person record and an address record is created but they aren't linked via the address_id column in the Person table. Am I missing a step in the controller? Thanks! New Action UPDATE def new @person = Person.new @person.build_address respond_to do |format| format.html # new.html.erb format.xml { render :xml => @person } end end Form Code UPDATE <%= form_for(@person) do |f| %> <% if @person.errors.any? %> <div id="error_explanation"> <h2><%= pluralize(@person.errors.count, "error") %> prohibited this person from being saved:</h2> <ul> <% @person.errors.full_messages.each do |msg| %> <li><%= msg %></li> <% end %> </ul> </div> <% end %> <div class="field"> <%= f.label :first_name %><br /> <%= f.text_field :first_name %> </div> <div class="field"> <%= f.label :last_name %><br /> <%= f.text_field :last_name %> </div> <div class="field"> <%= f.label :email %><br /> <%= f.text_field :email %> </div> <div class="field"> <%= f.label :telephone %><br /> <%= f.text_field :telephone %> </div> <div class="field"> <%= f.label :mobile_phone %><br /> <%= f.text_field :mobile_phone %> </div> <div class="field"> <%= f.label :date_of_birth %><br /> <%= f.date_select :date_of_birth %> </div> <div class="field"> <%= f.label :gender %><br /> <%= f.select(:gender, Person::GENDER_TYPES) %> </div> <div class="field"> <%= f.label :notes %><br /> <%= f.text_area :notes %> </div> <div class="field"> <%= f.label :person_type %><br /> <%= f.select(:person_type, Person::PERSON_TYPES) %> </div> <%= f.fields_for :address do |address_fields| %> <div class="field"> <%= address_fields.label :street_1 %><br /> <%= address_fields.text_field :street_1 %> </div> <div class="field"> <%= address_fields.label :street_2 %><br /> <%= address_fields.text_field :street_2 %> </div> <div class="field"> <%= address_fields.label :city %><br /> <%= address_fields.text_field :city %> </div> <div class="field"> <%= address_fields.label :state %><br /> <%= address_fields.select(:state, Address::STATES) %> </div> <div class="field"> <%= address_fields.label :zip_code %><br /> <%= address_fields.text_field :zip_code %> </div> <% end %> <div class="actions"> <%= f.submit %> </div> <% end %>

    Read the article

  • jQuery .next() and .prev() not working as they should!

    - by Luca Matteis
    I want to get the .next() and .prev() sibling of an HTML element without excluding TextNodes. I basically need to understand if an element is directly sorrounded by <br> HTML elements. This would return true: <br> <div></div> <br> This would return false: <br> Some text <div></div> <br> BUT this needs to also return true: <br> <div></div> <br> The third example basically uses an empty TextNode, or blankspaces, or newlines. What's the best way to do this?

    Read the article

  • Email postfix marked as spam by google

    - by Rodrigo Ferrari
    Hello friends, I searched about this question, found some few answers but no idea how to fix, the problem is that I realy dumb with all this! I configured the postfix and done everything how the install how to told. It send the email, but get marked as spam! The header is this one: Delivered-To: [email protected] Received: by 10.223.86.203 with SMTP id t11cs837410fal; Wed, 12 Jan 2011 04:02:21 -0800 (PST) X-pstn-nxpr: disp=neutral, [email protected] X-pstn-nxp: bodyHash=9c6d0c64fa3a4d663c9968e9545c47d77ae0242e, headerHash=1ab8726bd17a23218309165bd20fe6e0911627cd, keyName=4, rcptHash=178929be6ed8451d98a4df01a463784e6c59b3b4, sourceip=174.121.4.154, version=1 Received: by 10.100.190.13 with SMTP id n13mr537609anf.76.1294833740396; Wed, 12 Jan 2011 04:02:20 -0800 (PST) Return-Path: <[email protected]> Received: from psmtp.com ([74.125.245.168]) by mx.google.com with SMTP id w2si1297960anw.132.2011.01.12.04.02.19; Wed, 12 Jan 2011 04:02:20 -0800 (PST) Received-SPF: pass (google.com: domain of [email protected].br designates 174.121.4.154 as permitted sender) client-ip=174.121.4.154; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected].br designates 174.121.4.154 as permitted sender) [email protected].br Received: from source ([174.121.4.154]) by na3sys010amx168.postini.com ([74.125.244.10]) with SMTP; Wed, 12 Jan 2011 12:02:19 GMT Received: from localhost (server [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by brasilyacht.com.br (Postfix) with ESMTP id 87C121290142; Wed, 12 Jan 2011 09:50:29 -0200 (BRST) From: YachtBrasil <[email protected]> Reply-To: Vendas <[email protected]> Cc: YachtBrasil <[email protected]> To: [email protected] Subject: teste Date: Wed, 12 Jan 2011 09:50:29 -0200 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline MIME-Version: 1.0 Message-Id: <[email protected]> X-pstn-2strike: clear X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S: 1.96218/99.81787 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 3 (1.0000:1.0000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from <[email protected]> [db-null] I'm out of ideas on how to fix this, I think it's dns issue, but I have marked the spf inside my tinydns =( Is there anything I can check to know why this email is marked as spam? Any help will be appreciated! Thanks and sorry for my bad english.

    Read the article

  • In excel how can I consolidate information in rows based on 2 critera?

    - by Kevin
    I have a worksheet with columns A through BR. Column B contains customers (repeating values) Column J contains a filing date (repeating values) Column O contains loan information I would like to consolidate customers and filing date into 1 row and then have the loan information in subsequent rows appended to the end. Data looks like: Number | Customer | ...| File Date |...| Loan Information| 1 | Customer 1 | ...| 11/30/2012|...| Loan Info 1 2 | Customer 1 | ...| 11/30/2012|...| Loan Info 2 3 | Customer 1 | ...| 05/12/2011|...| Loan Info 1 4 | Customer 1 | ...| 05/12/2011|...| Loan Info 2 5 | Customer 2 | ...| 10/31/2012|...| Loan Info 1 6 | Customer 2 | ...| 10/31/2012|...| Loan Info 2 7 | Customer 2 | ...| 10/31/2012|...| Loan Info 3 8 | Customer 3 | ...| 03/16/2010|...| Loan Info 1 9 | Customer 3 | ...| 03/16/2010|...| Loan Info 2 10 | Customer 3 | ...| 07/01/2013|...| Loan Info 1 I would like to get to: Number | Customer | ...| File Date |...| Loan Information|...|BR|Loan Info 2| Loan Info 3| ect| 1 | Customer 1 | ...| 11/30/2012|...| Loan Info 1 |...|BR|Loan Info 2 3 | Customer 1 | ...| 05/12/2011|...| Loan Info 1 |...|BR|Loan Info 2 5 | Customer 2 | ...| 10/31/2012|...| Loan Info 1 |...|BR|Loan Info 2|Loan Info 3 8 | Customer 3 | ...| 03/16/2010|...| Loan Info 1 |...|BR|Loan Info 2 10 | Customer 3 | ...| 07/01/2013|...| Loan Info 1

    Read the article

  • split a textfile after each n matches to a new file using sed or awk

    - by ozz
    i tried to split a file in parts of n matches each. The file is just one line and the seperator is '<br>' foo<br>bar<br>.....<br> I just want to split the file in parts, where each file has 100 datasets (text plus <br>)( normaly 100 datasets, but at the end maybe less) I already played around with this ... split-file-in-2-with-sed and this split-one-file-into-multiple-files-based-on-pattern sed.exe -e "^.*.<br>{0,100}/g" < original.txt > first_half.txt The split do not work an the result is only 1 file instead of many.

    Read the article

  • Monorail - Form submission using GET instead of POST

    - by Septih
    Hello, I'm writing some additions to a Castle MonoRail based site involving an Add and an Edit form. The add form works fine and uses POST but the edit form uses GET. The only major difference I can see is that the edit method is called with the Id of the object being edited in the query string. When the submit button is pressed on the edit form, the only argument passed is this object Id again. Here is the code for the edit form: <form action="edit.ashx" method="post"> <h3>Coupon Description</h3> <textarea name="comments" width="200">$comments</textarea> <br/><br/> <h3>Coupon Actions</h3> <br/> <div>Give Stories</div> <ul class="checklist" style="overflow:auto;height:144px;width:100%"> #foreach ($story in $stories.Values) <li> <label> #set ($associated = "") #foreach($storyId in $storyIds) #if($story.Id == $storyId) #set($associated = " checked='true'") #end #end <input type="checkbox" name="chk_${story.Id}" id="chk_${story.Id}" value="true" class="checkbox" $associated/> $story.Name </label> </li> #end </ul> <br/><br/> <div>Give Credit Amount</div> <input type="text" name="credit" value="$credit" /> <br/><br/> <h3>Coupon Uses</h3> <input type="checkbox" name="multi" #if($multi) checked="true" #end /> Multi-Use Coupon?<br/><br/> <b>OR</b> <br/> <br/> Number of Uses per Coupon: <input type="text" name="uses" value="$uses" /> <br/> <input type="submit" name="Save" /> </form> The differences between this and the add form is the velocity stuff to do with association and the values of the inputs being from the PropertyBag. The Method dealing with this on the controller starts like this: public void Edit(int id) { Coupon coupon = Coupon.GetRepository(User.Site.Id).FindById(id).Value; if(coupon == null) { RedirectToReferrer(); return; } IFutureQueryOfList<Story> stories = Story.GetRepository(User.Site.Id).OnlyReturnEnabled().FindAll("Name", true); if (Params["Save"] == null) { ... } } It reliably gets called but a breakpoint on the Params["Save"] lets me see that the HttpMethod is "GET" and the only arguments passed (In the Form and the Request) are the object Id and additional HTTP headers. At the end of the day I'm not that familiar with MonoRail and this may be a stupid mistake on my behalf, but I would very much appreciate being made a fool out of if it fixes the problem! :) Thanks

    Read the article

  • IE: position two text lines on top and bottom corners in table cell?

    - by diggonce
    I have a table with dynamic data. And there is a specific line of text which should be displayed only when a user hovers over the table row. This line of text should be 'fixed' to the table cell's bottom edge. It works so far with Firefox, but fails in IE. Live code can be seen here: http://2010resolutions.org/test/index.html The text in red should be fixed to the table cell's bottom border. (They will have a fixed height and width) Any clues how to get this working in IE? Any help is appreciated. Here's the code: <style> table { width: 500px; background: gray; } td { vertical-align: top; } .wrapper { position: relative; background: green; } tr, td, .wrapper { height: 100%; padding-bottom: 0.75em; } .bottom { position: absolute; left: 0; bottom: 0; background: red; } .bottom { visibility: hidden; } tr:hover .bottom { visibility: visible; } </style> <table> <tr class="data"> <td> <div class="wrapper"> This is line 1<br /> This is line 2<br /> This is line 3<br /> <span class="bottom">Bottom line 1</span> </div> </td> <td> <div class="wrapper"> This is line 4<br /> This is line 5<br /> This is line 6<br /> <span class="bottom">Bottom line 2</span></span> </div> </td> <td> <div class="wrapper"> This is line 7<br /> This is line 8<br /> This is line 9<br /> This is line 10<br /> This is line 11<br /> This is line 12<br /> <span class="bottom">Bottom line 3</span> </div> </td> </tr> <tr> <td>&nbsp;</td> <td>&nbsp;</td> <td>&nbsp;</td> </tr> </table>

    Read the article

  • Better Understand the 'Strategy' Design Pattern

    - by Imran Omar Bukhsh
    Greetings Hope you all are doing great. I have been interested in design patterns for a while and started reading 'Head First Design Patterns'. I started with the first pattern called the 'Strategy' pattern. I went through the problem outlined in the images below and first tried to propose a solution myself so I could really grasp the importance of the pattern. So my question is that why is my solution ( below ) to the problem outlined in the images below not good enough. What are the good / bad points of my solution vs the pattern? What makes the pattern clearly the only viable solution ? Thanks for you input, hope it will help me better understand the pattern. MY SOLUTION Parent Class: DUCK <?php class Duck { public $swimmable; public $quackable; public $flyable; function display() { echo "A Duck Looks Like This<BR/>"; } function quack() { if($this->quackable==1) { echo("Quack<BR/>"); } } function swim() { if($this->swimmable==1) { echo("Swim<BR/>"); } } function fly() { if($this->flyable==1) { echo("Fly<BR/>"); } } } ?> INHERITING CLASS: MallardDuck <?php class MallardDuck extends Duck { function MallardDuck() { $this->quackable = 1; $this->swimmable = 1; } function display() { echo "A Mallard Duck Looks Like This<BR/>"; } } ?> INHERITING CLASS: WoddenDecoyDuck <?php class WoddenDecoyDuck extends Duck { function woddendecoyduck() { $this->quackable = 0; $this->swimmable = 0; } function display() { echo "A Wooden Decoy Duck Looks Like This<BR/>"; } } Thanking you for your input. Imran

    Read the article

  • How to get dropdown value using jsp:useBean and jsp:setProperty?

    - by littlevahn
    I have a rather simple form in JSP that looks like this: <form action="response.jsp" method="POST"> <label>First Name:</label><input type="text" name="firstName" /><br> <label>Last Name:</label><input type="text" name="lastName" /><br> <label>Email:</label><input type="text" name="email" /><br> <label>Re-enter Email:</label><input type="text" name="emailRe" /><br> <label>Address:</label><input type="text" name="address" /><br> <label>Address 2:</label><input type="text" name="address2" /><br> <label>City:</label><input type="text" name="city" /><br> <label>Country:</label> <select name="country"> <option value="0">--Country--</option> <option value="1">United States</option> <option value="2">Canada</option> <option value="3">Mexico</option> </select><br> <label>Phone:</label><input type="text" name="phone" /><br> <label>Alt Phone:</label><input type="text" name="phoneAlt" /><br> <input type="submit" value="submit" /> </form> But when I try and access the value of the select box in my Java class I get null. Ive tried reading it in as a String and an Array of strings neither though seems to be grabbing the right value. The response.jsp looks like this: <%@ page language="java" %> <%@ page import="java.util.*" %> <%@page contentType="text/html" pageEncoding="UTF-8"%> <%! %> <jsp:useBean id="formHandler" class="validation.RegHandler" scope="request"> <jsp:setProperty name="formHandler" property="*" /> </jsp:useBean> <% if (formHandler.validate()) { %> <jsp:forward page="success.jsp"/> <% } else { %> <jsp:forward page="retryReg.jsp"/> <% } %> I already have Java script validation in place but I wanted to make sure I covered validation and checking for non-JS users. The RegHandler just uses the name field to refer to the value in the form. Any Idea how I could access the select box's value?

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >