GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Java-scri-pt help (https://gfy.com/showthread.php?t=419096)

SickFinga 01-19-2005 02:17 PM

Java-scri-pt help
 
I need to check if a uses selected radio in the form
here is what i got

PHP Code:

if (form.usr.checked hahahaha false){
    
alert("Please select Yes or NO:");
    
form.usr.focus();
    return 
false;
    } 


But it doesnt work, user does not get an alert message

Clarion 01-19-2005 02:23 PM

Quote:

Originally Posted by SickFinga
I need to check if a uses selected radio in the form
here is what i got

PHP Code:

if (form.usr.checked hahahaha false){
    
alert("Please select Yes or NO:");
    
form.usr.focus();
    return 
false;
    } 


But it doesnt work, user does not get an alert message

is usr the name of the radio button and form the name of the form?

SickFinga 01-19-2005 02:31 PM

Quote:

Originally Posted by Clarion
is usr the name of the radio button and form the name of the form?


Yes, it is

SickFinga 01-20-2005 01:43 AM

bump :helpme

woj 01-20-2005 03:24 AM

Post a link to a page that shows the whole setup, it's not that easy to debug it given the info given... (or hit me up on icq: 33375924 before I go to bed)

Cogitator 01-20-2005 05:29 AM

You're kidding right? What kind of "if" statement is that?

celebx 01-20-2005 05:41 AM

mark the checkbox with id="checkbox_name" and access it using document.getelementById("checkbox_name")

if (document.getelementById("checkbox_name").checkedh ahahahafalse) {
alert();
}

celebx 01-20-2005 06:02 AM

ml_doc()
 
<script language="Javascript" type="text/javascript">
//By Snt ICQ 83226461 (@gmail.com)

// access an obect inside an document, compatible with ALL browsers
function ml_doc(id) {doc=(document.getElementById)?'getElementById("'+ id+'")':(document.layers)?'layers["'+id+'"]':(document.all)?'all["'+id+'"]':false;try {eval("document."+doc).constructor;} catch(e) {alert('function ml_doc() {\nreturn '+doc+'\n}\n\n'+e);}return eval("document."+doc);}

//usage:
// ml_doc('object_name').style.background='#FFFF00';


// hide an object
function ml_love(l) {for (i=1; i<arguments.length; i++) {if(lhahahaha1) {ml_doc(arguments[i]).style.visibility='hidden';} else {ml_doc(arguments[i]).style.display='none';}}}


//usage:
// ml_love(0,'object_name'); //visibility, object dimensional effect remains
// ml_love(1,'object_name'); //display, object is hidden completely

// unhide an object
function ml_unlove() {for (i=0; i<arguments.length; i++) {ml_doc(arguments[i]).style.visibility='visible';ml_doc(arguments[i]).style.display='';}}

//usage:
// ml_unlove('object_name');


function ml_lovestate(id) {if (ml_doc(id).style.visibilityhahahaha'hidden') {return 1;} else if (ml_doc(id).style.displayhahahaha'none') {return 2;} else {return 0;}}

//usage:
// if (ml_lovestate('object_name')) {
//alert();
//}

//usage:
// if (ml_lovestate('object_name')hahahaha2) {
//alert('display=none');
//}

</script>

grumpy 01-20-2005 06:10 AM

i respect all these guys who are giving sample codes etc. to help a guy out with his problem. Although it looks like the guy has no program skills at all. Why not buy a book if you wanna learn programming. Learn the basics etc.

DEA - banned for life 01-20-2005 07:44 AM

Quote:

Originally Posted by grumpy
i respect all these guys who are giving sample codes etc. to help a guy out with his problem. Although it looks like the guy has no program skills at all. Why not buy a book if you wanna learn programming. Learn the basics etc.

Ditto x 2 :1orglaugh

mortenb 01-20-2005 07:53 AM

That seems to be a lot of code to accomplish such a small thing..

Code:

function chkform(form) {
    if(form.usr[0].checked!=true) {
        alert("Please select Yes or No:");
        form.usr[0].focus();
        return false;
    }
}

Just put the [0] part on the name of the radio element in the code.. it just refers to the first radio element with the "usr" name.. if you want to check the second, it would me [1]..


All times are GMT -7. The time now is 12:04 AM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123