RichardRotterdam
Members-
Posts
1,509 -
Joined
-
Last visited
Everything posted by RichardRotterdam
-
don't you just mean pass the php variables to javascript? example <script> var t=<?php echo($t);?> var f=<?php echo($f);?> </script>
-
is t and f on the delete.php page or on the main page?
-
that's not ajax you need it is just plain javascripting because you dont need an external php page(or other serverside page) to update your page. Look into tutorials for javascript DOM and especially the function getElementById()
-
I think i got your point. check out the mootools frameworks with periodical function that can be handy i think http://docs.mootools.net/Native/Function.js#Function.periodical
-
actually this is where a lot of designers make a mistake some stuff should be made with HTML and CSS only because it sinply loads faster and if its done in the right way you can obtain your information quicker. Often I want my information quick and readable instead of a labyrinth of crappy flash effects.
-
here you go <form id="myform"> <fieldset> enable input:<input type="radio" onclick="changeInputStatus(this.value)" name="inputStatus" value="false" /> disable input:<input type="radio" onclick="changeInputStatus(this.value)" name="inputStatus" value="true" /> </fieldset> <input type="text" name="text1" /> </form> <script> //this variable refers to the input box now var element=document.getElementById('myform').text1; function changeInputStatus(setDisabled){ setDisabled=eval(setDisabled); if(setDisabled==true){ element.disabled="disabled"; } else{ element.disabled=""; } } //disables the input changeInputStatus(true); </script>
-
Need help with form validation...
RichardRotterdam replied to simple_man_11's topic in Javascript Help
I didn't really test the code well try this one it works fine with me case "checkbox": { if(!objValue.checked){ if(!strError || strError.length ==0) { strError =objValue.name+" needs to be checked"; } alert(strError); return false; } break; } And one tip try to use a good editor for editing your HTML files too see what errors you make in your html there a couple of error messages you will get in your javascript console because of bad code. Also try to look into tableless form CSS tutorials this will be more common in the future. Tables are such pain in the ass for layout. -
Making an AJAX script more dynamic
RichardRotterdam replied to HaLo2FrEeEk's topic in Javascript Help
Ok correct me if I am wrong. you want to build some kind of administration tool probably for a CMS. You want the following functionality in that module. 1. Insert new record into link_rotator table 2. Update a record from the link rotator_table (and changing the text to a input field) 3. Delete a record from the link rotator_table 4. the one I don't get You want all of this without refreshing the entire page I presume since that is probably the reason you took the ajax approach and that is what makes ajax so great -
Are you trying to make a serverside script return the time and continuously refresh?? :-\. That doesn't sound like the right approach if you want to display time why not use javascript only?
-
sounds more like a javascript problem then just HTML to me
-
Making an AJAX script more dynamic
RichardRotterdam replied to HaLo2FrEeEk's topic in Javascript Help
Just what is it exactly that the ajax script is suppose to do? like what actions are on your HTML page like buttons/onclick events etc. and what parameters do you want to send when a certain action is preformed. I can make that code look a lot cleaner with the use of mootools framework. I stepped away from Ajax scripting the old way because its simply requires to much coding. anyway give a description and I can help you write your ajax script in no time -
Just a few comments on that game. Your game sounds interesting. I recommend you start with a photoshop document to show what the design should look like. Use plenty of layers and descriptions. Then someone can easily convert it to HTML/CSS. I also recommend you use some javascripting or even Ajax because if its just PHP only you will have to do a lot of refreshing on your pages which will be a bit annoying for playing your game and probably will make the players loose interest soon because it isn't really user friendly
-
like this without javascript really <a href="deleteFiles.php?imageUrl=myJPG.jpg">delete image</a> or with javascript window.location="deleteFiles.php?imageUrl=myJPG.jpg"; then on your deleteFiles.php you just use a get <?php $_GET['imageUrl']; ?>
-
You can't really delete a file using javascript unless your using serverside asp javascipt. what you can do is use javascript to call a php page that deletes the file
-
lightbox works great for images but for none images it's not so great
-
Need help with form validation...
RichardRotterdam replied to simple_man_11's topic in Javascript Help
i found out the site where you downloaded the script and the code you gave was way to little to fix your problem. anyway here is your solution. in your gen_validatorv2.js file look up the function function V2validateData() probably on line 160 then find the code inside that function that looks like switch(command) { that one must be on line 174 now place the following code after the { character so your code looks like and make sure the other cases arent deleted. switch(command) { case "checkbox": if(!objValue.checked){ alert(objValue.name+" needs to be checked"); } break; now on your form page validate the checkbox as followed frmvalidator.addValidation("designtype","checkbox") it should work now -
Help with Javascript to trigger Mootools effects
RichardRotterdam replied to bronzemonkey's topic in Javascript Help
I use mootools too its great for fast js effects and ajax calls. I haven't used the accordion or scroll effect you. Maybe you should try to post on the mootools forum ppl there have more experience working with that framework -
yeah pretty much and I am so looking forward to the new OOP syntax which will make making havier Javascript applications much easier. But back to topic how the hell do you make the content fade with a dialogbox unfaded
-
Need help with form validation...
RichardRotterdam replied to simple_man_11's topic in Javascript Help
i think this line looks a bit odd this.addValidation = add_validation; try placing that line inside the Validator function like so function Validator(frmname) { this.addValidation = add_validation; this.formobj=document.forms[frmname]; not sure if that will solve it -
Need help with form validation...
RichardRotterdam replied to simple_man_11's topic in Javascript Help
I don't see the frmvalidator object script do have that one included to your page? it should look something like function Validator(id){ this.id=id; } -
answer yes just call a javascript function from flash like getURL('javascript:fromFlash()') and make the javascript function fromFlash() refresh some innerHTML with document.getElementById() uhm java!=javascript its easier then javascript really since it supports full OOP programming and in javascript 2.0 comming in 2008, javascript will look almost identical to actionscript. also Jscript ,javascript and actionscript are all ecma scripts
-
Well that's basically it but however fading the background without fading the div with the dynamic content is harder then it seems.
-
I noticed a little something. You have the id attribute in the select and your updating the innerHTML inside the the select. This is not right. To save you some pain concerning IE6 do NOT try to update the html inside the select box IE has some issues with it. look at your php ajax query it will echo something like: <select id="day"> <option></option> <option></option> <option></option> </select> and with the following line inside the function stateChanged() document.getElementById("day").innerHTML you will update the html inside your select so your updated page will look like: <select id="day"> <select id="day"> <option></option> <option></option> <option></option> </select> </select> hmmm that can't be good so try placing each select box inside a div instead like this <div id="day"> <select> <option></option> <option></option> <option></option> </select> </div> that should solve one thing now something else i saw inside your functionstateChanged() is saw this if(menu=="day") however your variable menu only exists inside the function updateMenu() and will cease to exist outside that function declare it outside that function var menu; function stateChanged(){ }
-
there are also plenty of cool javascript effect for what you want. Do a search on the word tooltip.
-
Ambitious drag and drop AJAX/PHP/MYSQL script request
RichardRotterdam replied to smujesse's topic in Javascript Help
you mean something like this? http://www.dhtmlgoodies.com/scripts/floating_gallery/floating_gallery.html