I know this is simple as cake but I've been using ASP.NET controls for way too long. I assume you have to do this via javascript with a regular XHTML input tag?
We have developed a page with a asp.net and debugging it accidentally we have discovered on our page button with the next code on onclik attribute
onclick="__doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton',''); __doPostBack('ctl00$FormPlace$m_userTaskMarkAsUnreadButton','');WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$FormPlace$m_userTaskMarkAsUnreadButton", "", true, "", "", false, false))"
It seems that the button do three postbacks but when we click it only cause on postback. With this code seems that de button will cause three postbacks!!
We have try it with Internet Explorer and Firefox and the button only cause on postback always. Are browsers who avoid that the button do three postback ? Or Is Asp.net server who avoid the three postback? We don't understand why the button behaves correctly if onclick attribute has three call to do Postbacks.
Thanks
<form enctype="multipart/form-data" method="post" action="mailto:[email protected]" accept-charset="UTF-8">
Is there a problem if mails are sent this way .. i wanna avoid using PHP codes..
I have some code:
- count = 0
- @clients.each do |client|
%div{:class => "grid_2#{(" alpha" if (count % 3) == 0) || (" omega push_2" if (count % 3) == 2) || " push_1"}"}= link_to h(client.name), client
- count += 1
I want to output an opening div tag right after the each statement if the (count % 3) == 0 and out put the end tag at the end of the block if the (count % 3) == 2 but I can't figure out how to get HAML to do this. Any ideas?
I have some user-submitted variables that I want to display in a different part of my site like this:
<div class="pre_box">Term: </div>
<div class="entry"><?php $key='term'; echo get_post_meta($post->ID, $key, true); ?></div>
Occasionally, these variables might be empty in which case I don't want to display the label for the empty variable. In the example above I would want to hide the <div class="pre_box">Term: </div> part. Is there some simple way to check if a php variable like the one above is empty and prevent the label from being displayed?
I have a set of anchors like
<a class="lb" href="#">text</a>
<a class="lb" href="#" style="width:200px">text</a>
<a class="lb" href="#" style="color: reen; width:200px">text</a>
that needs to be transformed to the following:
<a class="lb" href="#"><span>text</span></a>
<a class="lb" href="#"><span style="width:200px">text</span></a>
<a class="lb" href="#" style="color:green"><span style="width:200px">text</span></a>
I have no problem creating child span but don't know how to move parent's width styling.
I'm referencing my js files before the closing body tag, hoping they will be parsed last (as they're not needed untill last). However when I analyse activity with PageSpeed in Firebug, the images seem to be requested last.
How can i make the images higher priority than the js?
Hello. I'm using this regular expression for detect if an url ends with a jpg :
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*^\.jpg)/ig;
it detects the url : e.g. http://www.blabla.com/sdsd.jpg
but now i want to detect that the url doesn't ends with an jpg extension, i try with this :
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*[^\.jpg]\b)/ig;
but only get http://www.blabla.com/sdsd
then i used this :
var exp = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]*[^\.jpg]$)/ig;
it works if the url is alone, but dont work if the text is e.g. :
http://www.blabla.com/sdsd.jpg text
Fatal error: Call to a member function result() on a non-object in C:\wamp\www\system\application\models\users_model.php on line 8
<?php
class Users_model extends Model {
function get_records()
{
$query = $this->db->get('users');
return $query->result();
}
}
?>
Quite a while ago i was more in websites building then i am now.
In my time there where huge debates about what to use; tables or pure CSS alternatives.
I went out of the webdesigning, but now an old question re-surfaces.
What i would like to create is a web page design that depending on screensize, would self organize the page into columns, so that for example on a PDA it would show 1 column
On an old computer monitor, it would show 2 colomns, and on a widescreen laptop it would show 3 columns. I forgot how this was called and how it was done in the past, it had to do with XML and storing data seperate from design (if i remember well), perhaps these days better methods exist to do that, does this, anyone ring this a bell ?
Also i note a lot is possible with Jquery and and brouwser depending webkits.
But i need to make sure that it would run on all (modern) brouwsers : Iexplorer, Firefox, chrome
And Jquery is nice too, but i am kinda woried that some day one of these brouwser vendors decides that jscript like java isnt enabled by default (or is that very unlikely ?)11
Perhaps someone can point me to a method that is the prefered way to do this.
Hello All,
How can I escape a ' (single quote) in JS. This is where I'm trying to use it.
<input type='text' id='abc' value='hel'lo'>
result for the above code is "hel" populated in the text box. I tried to replace ' with \' but this what I'm getting.
<input type='text' id='abc' value='hel\'lo'>
result for the above code is "hel\" populated in the text box.
How can I successfully escape the single quotes.
I cannot make the image a background image to a div and round the div's corners because the image is resized, and as far as I know, you cannot resize a background image.
What are my options, if any? Open to all suggestions including wrapper divs and corner images.
Also, if it cannot be done in IE but there's a solution for Firefox, that's just fine with me.
Hi I want to count LI which does not have the UL , for the first level only,
but when I count this it shows size 4 instead of 2, its count the inner LI also.
<div class="navigation-container">
<ul class="first-level">
<li><a href="#">Link 1</a></li>
<li><a href="#">Link 2</a>
<ul>
<li><a href="#">Link2.1</a></li>
<li><a href="#">Link2.2</a>
<ul>
<li><a href="#">Link 2.2.1</a></li>
</ul>
</li>
</ul>
</li>
<li><a href="#">Link </a></li>
</ul>
</div>
jQuery for this.
jQuery(document).ready(function(){
var nosubnav = jQuery('.first-level li:not(:has(ul))');
var nosubnavsize = jQuery('.first-level li:not(:has(ul))').size();
jQuery(nosubnav).css('border' , '1px solid red');
alert('List item which does not have submenu '+nosubnavsize);
});
Link for the testing link text on JSBin,
thanks
Currently I have this markup that represents an icon container and some elements styled with CSS inside it that in the end show as graphic icon.
<div class="icon">
<div class="icon-element1"></div>
<div class="icon-element2"></div>
<div class="icon-element3"></div>
</div>
The number of the child elements can be different depending on the complexity of the icon.
What I want is to somehow move as much as possible to CSS stylesheet, so that ideally I would have only <div class="icon"></div> and the rest would just render from CSS styles, something close in concept to :before/:after, a kind of virtual divs. I don't want to use JavaScript to add the elements dynamically. It would be possible to do this if we had multiple :before/:after.
Here is an example of an icon I get by using the markup from above:
As you can see, there are 3 child elements representing gray case, white screen and turquoise button.
Please advise, how I can simplify this markup so that not to have to put all the divs each time I want this icon to be shown.
For example, the select box
<select><option selected="" value="">Please Select</option><option value='txt'>Text</option><option value='int'>Numbers</option><option value='bool' >Boolean</option></select>
has a string
$messageList=array ( 'txt'=>'text message', 'int'=>'int message','bool'=>'bool message');
What i would like to achieve is to display correspond message when the optition is select?
I have a form with a disabled submit button. Even though the user can't press this button, he can still hit Enter to submit the form. How do I prevent that?
Hey,
This is my first time with AJAX, so I'm a bit confused and need your help. I have four div id's and want to toggle hide/show between them based on result from database.
Sounds simple, eh! But it is hard to implement for me. HELP!.
This is my code -
<div id="1">HEya</div>
<div id="2">What's up?</div>
<input type="submit" id='approve' name="action" value="Approve" onclick="a()" class="approve" />
<input type="submit" id='reject' value="Reject" name="action" onclick="r()" class="reject"/>
<script language="javascript" type="text/javascript">
//if cookie exists, at the beginning the form should be hidden
if (<?php $responseanswer['response']=='approve'; ?> ){
document.getElementById('1').style.display = 'none';
document.getElementById('2').style.display = 'inline';
}
//if user clicks reject, hide one element dislay another
else if (<?php $responseanswer['response']=='reject'; ?>){
//if cookie exists
document.getElementById('2').style.display = 'none';
document.getElementById('1').style.display = 'block';
}
else
{
function a()
{
var a = document.getElementById('2');
document.getElementById('1').style.display= 'block';
}
//on reject creating a new cookie
function r()
{
var a = document.getElementById('reject');
document.getElementById('1').style.display = 'none';
document.getElementById('2').style.display= 'block';
}
}
</script>
Eveything is fine, but the div is not hiding.
I have a form which have a file input;
<%form_tag '/dboss/newsbsresult' , :remote=>true do %>
<input type="file" id="examsendbutton" name="txtsbs"/><br/>
<input type="submit" value="Gonder">
<%end%>
Here i want the user to select a txt file which i try to parse and use at server, but i cannot catch the uploaded file with this code,
def newsbsresult
@u = params[:txtsbs] #Or params[:txtsbs].to_s
p @u
end
What is the true way of achieving this?
Hi guys, i am creating a new site, based in a pre-existing web page
The original site is http://oasisrio.intermediasp.com/
Its works great in Firefox, Chrome, and IE
But the new one "oasisba.intermediasp.com"
Dont show the right bar in IE, i check all that i can think about and i dont found the problem.
Someone have any ideas why this is happening?
PD: Sorry for my crapy english
I am working on a web app and trying to code a form with two dropdown lists. The list in the second dropdown will be dependent on the selection from the first one. The task itself isn’t too complicated except that once the first selection is made, I need to make a database call to pull the data for the second dropdown. This is where I am having difficulty. Both lists are in fact populated from a database.
I am working on this in a python script and have been trying to do this w/ an onChange javascript function. The web app is built in Zope and page templates may be an option along w/ the python scripts.
Hello,
we have an web-application built in flash (it's actually just getting built :D) where is very important to be notified, when user closes his window.
Since it's in flash, we do not worry about Javascript, we do not support non-javascript users.
What is the safest (meaning it's 100% sure it gets called) X-browser way to call php script to close session, make some db changes, etc.?
Thank you
Hi, been playing with this for a few hours and can't figure it out.
jsFiddle example here.
Basically I want this to show on hover, and click it to toggle whether it is displayed or not. I thought this was the way to do it with display:block;, but I can't get it to work.
Thanks for any help.
I have a styling problem, I am using WordPress and want to do have the first two classes completely different to the others.
My ideal situation is to have:
.si-biplace:nth-of-type(3) { float:left; margin:20px 0px 0px 0px; }
.si-image:nth-of-type(3) { float:left; margin:20px 0px 0px 0px; border:0px; }
.si-title:nth-of-type(3) { width:100px; height:20px; margin:0px; font-size:7px; color:#FFFFFF; font-weight:bold; }
They seem to work fine when it is:
.si-biplace { float:left; margin:-10px 0px 0px 0px; }
.si-biplace:nth-of-type(2) { float:left; margin:-10px 0px 0px 15px; }
Is there a reason why it will not work with nth-of-type(3) but will with nth of type 2? I basically want different attributes for every next time the div is used but cannot have separate div classes as it runs through a php array.
I'd like to use the CSS property position:fixed to fix the position of an element but at the same time prevent the element from being positioned over my footer when the user scrolls to the bottom of the page. Is there a way of stopping an element from showing over a footer in this way?
Ok, first off, I didn't program this page with frames! I'll be getting rid of them later. For now I need to solve this problem.
There's a link within a frame. Instead of that link just changing the contents of the frame, I need it to change the URL of the entire window. How can I do this?
Thanks for any help