Login Register


my website form [help] filter_list
Author
Message
my website form [help] #1
Guys i was trying to make a form for my friend's website, and i just couldn't make it functional. Form is all good, but i cannot make it process the javascript code (onclick event on submit button) ( Javascript code which it's supposed to display form entry to the other page so administrator can see it.)

Here's javascript code.. Just so you can see what's word about
Code:
<script language="JavaScript"> function processing() { var klan = document.form_23456869121357.q4_imeKlana.value; var rezervacija = 'div>Ime klana: '+ klan + '</div'; document.getElementById("cwrequest").innerHTML += rezervacija; }

When i submit my form entry, the page on which it's supposed to display the variable "rezervacija" nothing shows up. ( That page got only one line of code <div> with id of: cwrequest
I would really appreciate if someone who knows javascript & html to help me out make this form functional.

If you can help me please PM me ( there i will provide you more info, everything you ask)
thanks :wub:

Reply

RE: my website form [help] #2
you are getting it wrong...we cannot add value to element if it is not loaded.

here you are trying to add a value to element "cwrequest" which is not loaded because its on other page.
[Image: fow57.jpg]

Reply

RE: my website form [help] #3
(12-12-2012, 01:43 PM)h4r0015k Wrote: you are getting it wrong...we cannot add value to element if it is not loaded.

here you are trying to add a value to element "cwrequest" which is not loaded because its on other page.

How can i load it?

thank you for replying Wink

Reply

RE: my website form [help] #4
Well, Javascript is not my forte, (i kinda hate the language), but id probably liken it to pushing the power button on your laptop and expecting your desktop computer to turn on/off. The two really arent connected.

If you want to use it like you have, the element would have to be on the same page as the javascript is. Or you could POST it to the other page and use a language like PHP to retrieve/load it. Those are the only two ways I know of. But like i said Javascript is not my forte, i dont know if there is another more complex way of doing that in javascript alone (i doubt it?).

Reply







Users browsing this thread: