The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Can I have java script in my templete or does it have to reside outside the templete
Please look at this my calendarjump templete and have modifyed the one that comes out of the box.
I plan to add more logic to my java script function first i got to get the basic stuff to work first. Can someone give me a idea why or what i am doing wrong when the user press the "Go" button nothing happens and it should it least go select another calandar. Please review what i have posted below and let me know what i am doing wrong a example of what it should look like would help me greatly. PHP Code:
Frank H. Shaw |
#2
|
||||
|
||||
You may have javascript in your templates. But, isn't on.form.submit() just a basic javascript call that you can do on an onchange? Do you need a function for it?
|
#3
|
|||
|
|||
I have to some how get my java script function to work with my form so that when a event happens in the form my java script function will process what was selected.
A function or example would help since you offered THANKS The other thing is the problem is the c value in the this.form.onsubmit(); in the select as the product came unmodifyed by me has a great deal to do with the selection of the calandar from the dropdown calendarjumo. I have been doing a lot of testing and playing with a number of ways and at some point before leaving the dropdown the value needs to be set to c and not some otehr value which i tried. I do not know where in the vbulletin product the actual logic is to do all this. I did in my playing around realize that i could change the value from c to y and z and it would show up on the adress bar of the browser as a get for those items selected so somewhere in the logic in vbullettin the logic over writes what was selected in the dropdown and only a value of c will the actual navbar show the correct calendar selected. I do not know if you can also shed some light on to what is happening and where this logic could be located. Now can you explain what events are supprted in the java script and how to get the two to handshake. THANKS Frank H. Shaw --------------- Added [DATE]1235858101[/DATE] at [TIME]1235858101[/TIME] --------------- Quote:
You say the on.form.submit() and only the onchange event is supported what about the onclick event etc. Which ones are supported and which ones are not? --------------- Added [DATE]1235864581[/DATE] at [TIME]1235864581[/TIME] --------------- I realizied that my java script weather it is needed or not I added the function in my java script but that still did not solve the problem - I still not getting the handshaking bettween my form and the java script. A good example of how I have to do it inside the templete would help and a little explianation also would help why my handshakeing is not working. THANKS Frank H. Shaw |
#4
|
||||
|
||||
Sorry, I don't write javascript, so I can't give any examples. I just know that looking through the vb templates always shows onchange="on.form.submit()" when it is used.
|
#5
|
|||
|
|||
I will try that and see if that makes a difference?
Mybe someone else seeing the post might have more understand of java script and help me through it. I will let you know if it works or does not THANKS Frank H. Shaw --------------- Added [DATE]1235867361[/DATE] at [TIME]1235867361[/TIME] --------------- Quote:
Nope still does not work - can someone help me with the handshaking bettween my form and java script. THANKS Frank H. Shaw --------------- Added [DATE]1235873445[/DATE] at [TIME]1235873445[/TIME] --------------- I need to tell if my java script is being called now that my leastest version of my templete i now get my selection in the dropdown to actual display the correct calendar the one selected by the user in the drop down. Here is the working copy you can see the changes i had to make! PHP Code:
Ok The above works but how can i debug my java script so that I know it is being called without have header output errors which would happen if i just do a echo someone must have a trick that i can use. I could do a echo and then exit but that will not really helo if i want to keep the web page coming up and if i use the echo the web page will over write my echo? THANKS Frank H. Shaw |
#6
|
|||
|
|||
Quote:
|
#7
|
|||
|
|||
I am sorry I should have been a little clearer then what i am asking - Is there a general output / debuging function that is built in to vbulttin that I should be using to debug my scripts.
Up to this point ot has not been a problem to work around the issues of debugging but now that I am going to be getting my java function to be called from my form and still testing that to see of the handshaking is there or not. What I do know so far is the following is key to bring up the correct calandar when selected from the drop down. That is this: PHP Code:
It seems a lot of logic is built around this PHP Code:
THANKS Frank H. Shaw --------------- Added [DATE]1235920034[/DATE] at [TIME]1235920034[/TIME] --------------- It still is not working my java function never gets called WHY? Please explain WHY? I have finshed my testing and do not see that my java function is getting called so what is wrong with the handshaking the calling of my java function from the onclick event is the onclick event not supported. I need to some how have my java function called before submiting the form in a get - please again review my posting and see what needs to change? THANKS THANKS Frank H. Shaw --------------- Added [DATE]1235955488[/DATE] at [TIME]1235955488[/TIME] --------------- The handshaking is now working just fine and I should have a few other issues around this but at least my form is now calling my javascript function. THE FOLLOWING WORKS: PHP Code:
The have to add the code to the form: <form name="myform" action="calendar.php" method="get" onsubmit="process_selected(this)">. So when the form is submitted (onsubmit) , the function process_selected will be run and it will pass a pointer to the form (this) as a variable. Then the function will accept a variable and assign it the name form, and then it will submit it (form.submit()). THANKS Frank H. Shaw |
#8
|
|||
|
|||
i always find it easier to pull my javascript from external file and then use a plugin that is in global start for it to function. Just so it is seperate and you can find the issues quicker and you use just a variable where you need to add it .
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|