I want to change right click values which clicking on a particular item on a WebPage and make right click values to functioning. I am a PHP developer..
Kindly see the image below
http://2.bp.blogspot.com/_EzIJxJICfGw/TOuRqAkAn6I/AAAAAAAAAHo/cHERiyuPo90/s1600/right_click.jpg
If you use jQuery, you can try http://plugins.jquery.com/plugin-tags/right-click-menu.
You need to look at javascript as this is largely clientside behaviour
Maybe somethign like this jquery plugin
Then you can call php via ajax
You cannot change the default rightclick menu that the browser draws for you. You can, however, prevent the default behavior of the rightclick-event and draw your own menu (made up of HTML and CSS) at the cursor position. This requires some JavaScript knowlege, though.
Related
I'm using jQuery Form Wizard and I am in the need of making it translatable. I've got the actual translation working for the form for everything but the buttons which seem hard-coded (and I am really new to jQuery).
Is there a way of making the labels change dynamically according to the rest of the translation support, which uses an URL parameter and the translated strings in variables? This is coded with php.
Edit: That I need help with is to change the label of the previous, next and submit button in jQuery Form Wizard module: http://www.thecodemine.org/#
Edit 2: Well, I've tried to actually change the value of the HTML, but it only works for the back button. Next button label is still "Next". I also tried using jQuery to change the value for me, with the same result, using #next.val("My own next value");
No, PHP can only edit the document before it is loaded into the browser, not after being displayed.
An option is to use a Javascript Translator such as Google Translate.
Another option is to set the language of your webpage as a meta tag and hope the browser asks to translate the page (ie Google Chrome will)
Edit:
Looking at the JQuery code wizard docs, there are two build in functions textNext and textBack and finally (textSubmit) ie
$('#idOfForm').formwizard('textNext','newText');
I want to change the appearance of the web page according to an input is focused or not, If it is not focused, it will display something and if it is focused, replace something with another things simultaneously.How can i do that that?Can it be done with PHP?
Thanks
You will definitely have to use JavaScript for this if your making changes beyond changing styling of the checkbox. If its imperative to get information from the server on focus you could make an ajax request to a php file to have data returned. The link below is an example using JavaScript and onfocus to change a div elsewhere on the page.
Live Demo
Simple snippet.
var check = document.getElementById("YourIdOrWhatHaveYou"),
check.onfocus= function(){
// DO your thang!
}
no, you'll need css, see the
:focus selector
(php is serverside code only, which means it cannot see if the user has put focus on anything, javascript could do it but css would be best in this case.)
PHP cannot do this for you as it is a server side language and doesnt know about focus.
If you want to change the the appearance of something based on focus, #red-X already mentioned the :focus selector in css.
If you want modify the content of the object or others in the DOM based on if something has focus, you'll need to use javascript, the jquery library allows you to use the same :focus selector to detect if an object has focus or when it gets/losses focus.
I have a multi-part form that will use PHP for the server side database insertion. The form needs to be validated, and I intend to use JQuery Validate to display one icon if the section validates, and another if the section does not.
I'm aware of the use of collapsible panels or DIVs. However, I need to use this same collapsible effect inside my form. How can this be achieved either via JQuery or another client side library?
Thanks much!!
Since you're at the point to decide what framework to use you may check the collapsible forms by ExtJS framework, it may give you some initial idea.
EDIT
#SidC: OK, if you're going with JQuery, you'll better not to mess up with Ext. Don't see much pain to implement if from zero using JQuery::Accordion plugin plus the JQuery::DIALOG. And check this feed
JQuery Accordion: how to embedded it into a dialog box?
You can hide inside a form just as easily as outside.
object.style.display = "none"
is the JS.
Wrap what you're showing and hiding in a div and go to it.
Scott is correct, and not only because we share the same name.
Wrap your HTML form in a div, and then use this:
http://www.dynamicdrive.com/dynamicindex17/animatedcollapse.htm
It's animated too ;)
I am having difficulties in the following problem:
I have a screen in PHP which displays a list of some records when I choose any of these
records (by clicking) it gives me a web site to share the data with this record. So far, it works.
I need to click on some of these records, instead of him
open another page, scroll down the screen and the record data to appear in the same screen, ie without opening another window.
Do you have any idea how to do this?
Thanks
You'll need to have a DIV at the bottom of the page, which will be completed by using an Ajax call and some javascript or jquery.
Without going into too much detail, heres what needs to happen:
User clicks a link which fires off an ajax request.
The backend PHP script takes the ajax call and generates either XML or pure HTML and returns the data.
JQuery or JavaScript on the original page takes the return and populates the empty DIV at the bottom of the page.
Regards
It sounds like you'll need to use ajax to pull this off.
I would personally suggest starting with reading up on the jQuery javascript library if you are not familiar with it already. It provides a very good set of ajax tools to work with.
Create a DIV layer on the bottom of the page. Use a simple AJAX library like this
Create a new php page that will only load a new record based on the recordID and call this page on the onclick method of your link that is now opening in the new window
I would try adding some jQuery to your page to handle this effect.
If you do add jQuery here is a function written to do just that:
http://pastebin.com/SeMHwSgg
Call the script like so:
Where a is the record you are having them click on and href="[some anchor]" located at the spot on the screen where you want the scrolling to stop:
<a id="gotop" href="#" onclick="goTop();return false;">click here</a>
So
Indeed, there is no error, it just does not have the effect that (scroll down the screen and show the record data). For now, it only shows the record open in another window.
I have a button on a page. The button is an image sprite, and it choose ADD in green. I want the user to be able to click this button, and then do a few things:
1) That button makes a call to add an item to my MySQL database, without reloading the page. (I think this needs AJAX.)
2) The button background image sprite changes such that it now says REMOVE in red.
I don't understand how to do this. I'd greatly appreciate a basic walk through on how to do it.
Have a look at this page that i created to demonstrate css sprites.
I call a function on click of the button that changes the image of the button.
You can call a function that does an ajax call inside this function.(Try looking at the source)
Take a look here to learn about ajax and database related stuff.
It will be easier to make the "AJAX" call if you use a JavaScript framework, such as jQuery.
You'll tell jQuery to issue a POST request (with data attached) to a PHP script on the server. The PHP script you write will add the item to the database. When the request is complete, jQuery will run a "callback" for you. In your callback, you can change the styling of the button.
Please see jQuery.post
That's the general overview and should get you started. Please comment on this answer if you'd like more details or examples on a particular part of the process.