This topic is locked

Jquery Instructions

3/30/2012 8:29:47 AM
PHPRunner General questions
A
Athlon author

Can some one please provide instructions on how to use jquery plugins with Phprunner. I can seem to get anything to work. Looking at examples and tutorials I keep running into a wall.
This post here seems clear enough but again does not work.It must be me..
http://www.asprunner.com/forums/topic/16126-how-to-add-custom-alert-on-jquery/

I went through a web tutorial and successfully created a popup using just the jquery lib, using any plugin I am stuck.
I understand Jquery is already installed. Where do I put my plugin and how do I call it. Do I need to call jquery as well in the script.

header in visual or java event?
A easy guide / example would be most helpful.
Thanks for any guidance.

A
Athlon author 3/30/2012

Thank you - I have read this numerous times. I keep finding contradiction else where in the forum maybe versions.

the java seems to need stripping of tags to be used in the events.. a php thing I assume.
I am new to this and getting no where fast.
I have done the following but obviously Im missing some basics that seem hard to find in any tutorial.
My edit page has sections. I have pasted the following code in the place directly after the end body tag on teh edit page in html mode.

I have put the jquery plugin files in a new folder called sis in the project.

I get no errors - but it does not work.. Can you please help or direct me.
<script type="text/javascript" src="include/jquery.js" ></script>

<script type="text/javascript" src="sis/sisyphus.js" ></script>

<script>

$(document).ready(function(){

$('form').sisyphus( {timeout: 5 } );

});

});

</script>

A
Athlon author 4/2/2012

A lot of views - No help.... Please can you offer a solid process to applying jquery plugins.
I have 2 brains on this and still cant not understand the issues.
Any working example with where what goes where...
Does it actually work at all, or only limited.
I cant get a thing to work, only javascript.
This sisphus is a perfect for what I want - but this and others do not work.. nada.
Thanks,
Mike.

C
cgphp 4/3/2012

You don't need to include jquery. Place after the end of body only the following line:

<script type="text/javascript" src="sis/sisyphus.js"></script>


In the "Javascript onload" event, enter this code:

$('form').sisyphus( {timeout: 5 } );
A
Athlon author 4/3/2012

Thank you for some help with this. However, I am totally ready to dump this idea. I can not get jquery to work at all. I have followed everything... it will not work in phprunner. I have tried different plugins.. will not work.
I don't know what to do.... I can not believe it is this difficult.

I have made a html form, referenced my own Jquery and sis plugin and all works perfect.
My exact scenario if you can see what is wrong.
My form has several layouts in edit mode. Open each layout has the boxes for free text.
On edit page (html mode) I have a folder in the phprunner root folder called sis with the jquery plugin within. I have also tried http link to my server and other variations.
{END body}

</BODY>
<!--Begin Sis code-->

<script type=text/javascript

src="sis/sisyphus.js"></SCRIPT>

</HTML>
Next on the events onload java (Edit Page) I have this.
$('form').sisyphus( {timeout: 5 } );
It does nothing. Can you identify what is wrong? I been at this for 3 days, used different plugins - none will work. Im using build 10638
The only thing I have not tried is changing the jquery file in runner ( which I understand is a bad idea ) I have however tried linking to another jquery file that my working forms are using - still no go.
Hoping for a miracle from a master that says oh yes.. its that !
Mike.

C
cgphp 4/3/2012

Why if the article says "before the {END flybody}" you put the code after.
The correct code is:

<!--Begin Sis code-->

<script type=text/javascript src="sis/sisyphus.js"></SCRIPT>

{END body}

</BODY>

</HTML>


Check firebug for error.

A
Athlon author 4/3/2012

No errors in firebug - does not work.... changed code position.. sorry .. I had it all over the place in trying.
However, if I use the jquery from runner in my working forms... they do not work either. so its related to the jquery for sure. My forms are using jQuery v1.7.2. but the plugin is said to work on 1.3+
Is there a way to call a different jquery for a page. I think runner is using jquery 1.6.1.
Is there a working way around this. I am sure its a compatibility issue now, although as I understand it, it should work fine.

C
cgphp 4/3/2012

Make sure you are using an HTML5 enabled browser.

A
Athlon author 4/3/2012

I use chrome... I understand it needs to be html5 and the html form I have works fine in chrome. However using the jquery from the include folder on the same form.. it does not work, Is jquery in phprunner.
Thanks for the help with this, I really appreciate the quick feedback. Can you confirm anything above in my previous quote... or suggest a work around. Has anyone actually got anything to work using jquery with 10638. I am almost 100% sure its the bundled jquery in runner.

A
Athlon author 4/4/2012

Cristian,
I kind of got this working but.... here I think is the problem. Can you confirm please.
looking at the phprunner pages - they are not forms at all but table cells so are naturally excluded from the jquery. Embeding my own form on the phprunner page.. that all works.. OMG... the boxes on the runner page are all inside of <Table> !

C
cgphp 4/4/2012

Could you post a demo link of your app?

A
Athlon author 4/4/2012

Thx. here are 2 links just a simple form.
carbonreduction.eu/Kim This when going to add record page has an embeded form and it works on the form boxes only. Refresh the page and the entered txt remains. Closing the browser keeps the text also.
Carbonreduction.eu/Kim2 This has the jquery loaded on the edit record page. It is just the runner page as is.. it does not keep any text on refresh as I expected. Its as if the text boxes are not on a form.. as the code implies to me.
Login for both admin:admin
I guess that what I thought was happening is not the case then? proper disappointed. Please keep in mind I am a novice, Have learned a lot however, on this little journey. I am hoping its me.. I just cant see it though.
Thanks,
Mike.

C
cgphp 4/5/2012

Check this alternative: http://rikrikrik.com/jquery/autosave/ The selector could be also a single element of the form.