[Solved] Looking for a regex to validate Cuban identity card

Note: this is uses rough date validation via pure RegEx (ie. any month can have up to 31 days): [0-9]{2}(?:0[0-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])[0-9]{5} You can test if a string matches via JavaScript like so: /[0-9]{2}(?:0[0-9]|1[0-2])(?:0[1-9]|[12][0-9]|3[01])[0-9]{5}/.test(‘82061512345’); // returns true because it is valid If you need true date validation I would do something like the following: var id1 = … Read more

[Solved] Progress Bar text

Use the CSS ::after selector and attr() function for this. The ::after selector appends text to the end of the element, while attr() returns the value of a given attribute. function update_progressbar() { var opt1 = parseInt($(‘option:selected’, $(‘#FirstQOne’)).val()); var opt2 = parseInt($(‘option:selected’, $(‘#FirstQTwo’)).val()); var opt3 = parseInt($(‘option:selected’, $(‘#FirstQThree’)).val()); var opt4 = parseInt($(‘option:selected’, $(‘#FirstQFour’)).val()); var opt5 … Read more

[Solved] Display Divs one below the other [closed]

You need CSS column layout. Something like this: #parent { width: 100%; height: 500px; background: #eee; -moz-column-count: 3; -moz-column-gap: 20px; -webkit-column-count: 3; -webkit-column-gap: 20px; } #parent .box { width: 250px; height: 80px; background: #AAA; margin-bottom: 10px; display: inline-block; } Demo: http://jsfiddle.net/J8A24/ Support: browser support chart.Further reading: Multiple Columns For IE you may want to use … Read more

[Solved] Search for a local html file by name

In Python 2.x, this could be done as follows: from bs4 import BeautifulSoup filename = raw_input(‘Please enter filename: ‘) with open(filename) as f_input: html = f_input.read() soup = BeautifulSoup(html, “html.parser”) print soup solved Search for a local html file by name

[Solved] How to truncate a list item [closed]

It’s certainly possible to achieve this with a combination of CSS and JavaScript. What you want to do is limit the number of items displayed, and then check which elements should be truncated to ellipsis with modulo. This can be seen in the following example which uses jQuery: $(document).ready(function() { var maxToShow = 3; // … Read more

[Solved] HTML Move List To Side [closed]

try margin-top: 10%; instead of padding-top:500 in .server_options in css .server_name { font-size: 50; padding-left: 5; z-index: -1; display: inline-block; padding-top: 0.001%; } .right_buttons { z-index: 1; list-style: none; float: right; vertical-align: top; display: inline-block; } .option_button { padding-bottom: 20; font-size: 30; text-align: center; text-decoration: unset; list-style: none; font-weight: bold; } .option_text { text-decoration: none; … Read more

[Solved] Pin-board effect with CSS [closed]

You can do something like the Pinterest layout in most current browsers using CSS multi-column layouts, it will break in IE9 and older versions. Here’s a jsFiddle. I have added some more div’s for demonstration purposes. html, body { height: 100%; } body { width: 420px; -webkit-column-count: 2; -webkit-column-gap: 20px; -moz-column-count: 2; -moz-column-gap: 20px; column-count: … Read more