:)

Hi mikulucky,

It seems the IE assigns 'Auto' as the default margin for the div. You could set the default margin-left as 0. The script would look like.
[ICODE]
$(document).ready(function() {
var $left = $('#content .inner2');
$left.css('marginLeft',0);

$('#bottomright a').click(function() {
    $left.animate({
        marginLeft: parseInt($left.css('marginLeft'),10) == 0?$left.outerWidth():0
    });
});
return true;

});
[/ICODE]

Hope that works.

Cheers :)

Hey that looks great..

Hi,
Your code seem to be working fine. Are you getting Javascript any errors? If any please check your error console. Also is there any use of passing the two parameters to the function.

Try this...

[CODE]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Shopping Calculation</title>

<script type = "text/javascript" >
/ <![CDATA[ /
function CalcShopping(promt) {
promt = parseFloat(promt)
if (promt <= 25) {
var calcLess = promt + 1.50;
window.alert("Your total charge for handling and shipping plus your item is $" +calcLess+ "");
}
else if (promt > 25)
{
var calcMore = (promt * 10 / 100) + promt;
window.alert("Your total charge for handling and shipping plus your item is $" +calcMore+ "");
}

}
/ ]]> /
</script>
</head>

<body>
<script type= "text/javascript" >
/ <![CDATA[ /
var promtBox = window.prompt("Please enter your item charge", "Here");
CalcShopping(promtBox);
/ ]]> /
</script>
</body>
</html>
[/CODE]

Use
[CODE]
position:absolute;
[/CODE]

in your style.

dipakatcvrca, as arrgh said frames aren't the right solution. Its like making your site more vulnerable and going back in time. "Hope fully this will work for web developers" this ain't true.

Maybe try like this..
[CODE]
$("h2 em").html(largeAlt);
[/CODE]

Yes teedoff...kind of a rare it is... :)

You have to be clear what you are going to build. Ask your colleagues maybe..

OK, so you have the user selected multiple options. So when the user submits the form, you get the selected options as a list which I suppose is saved to the database.

Now while editing the user profile, will have to query and get the selected options from the database. So you get a list of selected values. Now you will have to check against each option whether its in the list, if true, then make it selected.

Since I'm using ColdFusion, I would do something like this..
[CODE]
<select name="sel" multiple="multiple">
<option value="red" <cfif listFind(myList,"red")> selected="selected"</cfif> >red</option>
</select>
[/CODE]

Where 'myList' is the list of selected values from the database and listFind checks whether item "red" is in myList. If it finds, then appends the attribute selected to the option.

To make the options selected by default, use the attribute selected="selected" like..
[CODE]
<select>
<option selected="selected"></option>
</select>
[/CODE]
You will have to check which all options need to have selected attribute before adding to it.

Yes that would break on large strings..Was wondering what went wrong!My senior Dileep pointed it correctly..Actually the while condition wasn't correct. Have to check the string length each time. This would fix it..hope so.. :) .

[CODE]
<cfscript>
myString = "123456789ABC66HYIGGasdfsdfewqrdsfsdfsdfsda111sdf134sa65d4asUUJJUIP";
breakPosition = 5;
while(breakPosition < len(trim(myString)))
{
myString = insert("-",myString,breakPosition);
breakPosition = breakPosition + 6;
}
</cfscript>
<cfoutput>#myString#</cfoutput>
[/CODE]

Try..

[CODE]
<cfscript>
myString = "123456789ABC66HYIGG";
myStringLength = len(trim(myString));
breakPosition = 5;
while(breakPosition < myStringLength)
{
myString = insert("-",myString,breakPosition);
breakPosition = breakPosition + 6;
}
</cfscript>
<cfoutput>#myString#</cfoutput>
[/CODE]

Hi new_developer,

I think a better way may be is to use regular expression to check.Actually the loop thing ain't look good :).
You could use this simple regEx.Please check it. Seems to be working fine.

[CODE]
<script type="text/javascript">
var myString= "ggekr6k";
var regEx = new RegExp("[0-9]");
//Variable 'hasNumber' will be true if the string contains number or false if it doesn't.
var hasNumber = regEx.test(myString);
</script>
[/CODE]

Not sure about that.One way maybe is to loop individual letters in the string and check whether its numeric or not.

Hi tjmoosh,
This is the entire code with the changes.Please check it and know whether thats the requirement.Hope that works. :)

[CODE]
<body>
<div>
Newspaper<br>
<select id="newspaper" NAME="newspaper" style="width:350px" onchange="disable(this)">
<option value="null"></option>
<option value="news1">news1</option>
<option value="other">Other</option>
</select>
<br><br>

    Magazine/Trade<br>
    <select id="magazine" NAME="magazine" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="magazine1">magazine1</option>
        <option value="other">Other</option>
    </select>
    <br><br>

    Web<br>
    <select id="web" NAME="web" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="web1">web1</option>
        <option value="other">Other</option>
    </select>
    <br><br>

    TV<br>
    <select id="tv" NAME="tv" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="tv1">tv1</option>
        <option value="other">Other</option>
    </select>
    <br><br>

    Radio<br>
    <select id="radio" NAME="radio" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="radio1">radio1</option>
        <option value="other">Other</option>
    </select>
    <br><br>
    Other
    <input name="OtherOutlet" id="OtherOutlet" type="text" size="50" maxlength="255" disabled="true"><br /><br />
    <input type="button" value="Reset" onclick="enableAllSelect()">
</div>

</body>
<script type="text/javascript">
function disable(element)
{
var selectArrayId = ["newspaper","magazine","web","tv","radio"];
var excludeId = element.id;
var selectValue = element.value;

    if(selectValue == "other")
    {
        document.getElementById("OtherOutlet").disabled=false;
    } 

    for(x in selectArrayId)
    {
        if(selectArrayId[x] != excludeId)
        {                                       
            document.getElementById(selectArrayId[x]).disabled=true;
        }
    }
}

function enableAllSelect()
{
    var selectArrayId = ["newspaper","magazine","web","tv","radio"];

    for(x in selectArrayId)
    {
        document.getElementById(selectArrayId[x]).disabled=false;
        document.getElementById(selectArrayId[x]).value="null";
        document.getElementById("OtherOutlet").disabled=true;
        document.getElementById("OtherOutlet").value="";
    }
}

</script>
[/CODE]

tjmoosh commented: Very helpful! +1

Not clear what your requirement is. Selecting state from the drop down should make selected what?

Try this..Not sure whether thats what you require.

[CODE]
<script type="text/javascript">
function toggleDiv()
{
var boxChecked = document.getElementById("other").checked;
var myDiv = document.getElementById("details");

boxChecked ?myDiv.style.display="block":myDiv.style.display="none";

}
</script>

<label class="checks">
<input type="checkbox" name="Other" id="other" onchange="toggleDiv()" />
Other</label>

<div id="details" class="checks" style="display:none">
<label >
<input type="text" name"details" size="30" />Please Explain</label>
</div>
[/CODE]

Hi minimogul,

There are lots of jQuery tutorials available, me also a beginner in this. You can start learning from the official jQuery site [URL="

Hi try this...

[CODE]
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.4.min.js"></script>

<script type="text/javascript">

$(document).ready(function(){
    $('#myTextBox').click(function(){
        $('#myTextBox').val("");
    });

    $('#myTextBox').blur(function(){
        var currentText = $('#myTextBox').val();
        if(currentText == "")
        {
            $('#myTextBox').val("Enter text");
        }
    });
});     
</script>

</head>

<body>
<input type="text" id="myTextBox" value="Enter text">
</body>
[/CODE]

minimogul commented: Just Awesome no need to say anymore. +1

This would enable all the select options..
Put this Reset button in the body:
[CODE]
<input type="button" value="Reset" onclick="enableAllSelect()">
[/CODE]

In the script add this function:
[CODE]
function enableAllSelect()
{
var selectArrayId = ["newspaper","magazine","web","tv","radio"];

    for(x in selectArrayId)
    {
        document.getElementById(selectArrayId[x]).disabled=false;
    }
}

[/CODE]

LogicWeb I'm not sure but if you are using any other js frame work, conflict may occur..Try declaring this at top of your script
[CODE]
<script>
var $j = jQuery.noConflict();
</script>
[/CODE] and..
Now use $j instead of jQuery in your code like $j("#id").click();
Not sure whether that works,but anyway give a try..

Yes always tjmoosh..Ok just out of curiosity, you said the code is behaving opposite..then try removing the '!' in the line..
ie try like this..
[CODE]
if(selectArrayId[x] = excludeId)
[/CODE]

Not sure daviddoria, but you could parse the XML in javascript.

[QUOTE=almostbob;1422735]thats useful code, which I have added to my samplelist, than kyou
but not intuitive naming, in 18months time when there is a rewrite [icode]function disable(element)[/icode] may cause programmer errors, why not [icode]function disableallother(element)[/icode]
is there a length limit to variables in javascript that I missed or some such[/QUOTE]

Yes almostbob the naming of the function wasn't right..just gave it for test..should change it... :)

tjmoosh as almostbob said, please check whether the line
[CODE]if(selectArrayId[x] != excludeId)[/CODE]
is in your code.

Try this...
[CODE]
<body>
<div>
Newspaper<br>
<select id="newspaper" NAME="newspaper" style="width:350px" onchange="disable(this)">
<option value="null"></option>
<option value="news1">news1</option>
</select>
<br><br>

    Magazine/Trade<br>
    <select id="magazine" NAME="magazine" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="magazine1">magazine1</option>
    </select>
    <br><br>

    Web<br>
    <select id="web" NAME="web" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="web1">web1</option>
    </select>
    <br><br>

    TV<br>
    <select id="tv" NAME="tv" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="tv1">tv1</option>
    </select>
    <br><br>

    Radio<br>
    <select id="radio" NAME="radio" style="width:250px" onchange="disable(this)">
        <option value="null" ></option>
        <option value="radio1">radio1</option>
    </select>
</div>

</body>
<script type="text/javascript">
function disable(element)
{
var selectArrayId = ["newspaper","magazine","web","tv","radio"];
var excludeId = element.id;

    for(x in selectArrayId)
    {
        if(selectArrayId[x] != excludeId)
        {                                       document.getElementById(selectArrayId[x]).disabled=true;
        }
    }
}

</script>

[/CODE]

Iam not sure whether that will work. Try querying the name of the images and keep it in an hidden field.You can then loop the list and change the images according to it.

tcollins412, this seems to be resolved in your thread [url]http://www.daniweb.com/forums/thread331589-2.html[/url]