469,271 Members | 1,014 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,271 developers. It's quick & easy.

Problem with onClick="function()"

1
how to pass input value form a page into a database using this onClick function.
<input type="button" name="save" value="SIMPAN" onClick="save_all()">
i've tried a few times, each time i click the button, its work but the values were not insert into the database, its null!!

this is my function save_all() look like:-

<script language="JavaScript" type="text/javascript">
function simpan() {
window.open("signDaftar.cfm");
window.close();
}
</script>

and signDaftar.cfm, supposed to be the action form which is contained
CFML :-

<cfquery name="InsertSyarikat" datasource = "#application.dsn#">
insert into maklumat_syarikat (sykt_nama,...)
values (

<cfif IsDefined("form.namasykt") AND #form.namasykt# NEQ "">
('#form.namasykt#')
<cfelse>
NULL
</cfif>
, ......
)

so, please somebody help me...thanks
Apr 19 '07 #1
1 8299
acoder
16,027 Expert Mod 8TB
Welcome to TSDN.

To have form variables on the action page, you need to post the form. All you have done is opened a window.

If you want to post to a new window, set the target as "_BLANK". Change that button to a submit button. Specify the action in your form tag too.

Post again if you still have problems.

Hope that helps.
Apr 19 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

2 posts views Thread by Peter | last post: by
11 posts views Thread by jesdynf | last post: by
5 posts views Thread by Maria Sudderman | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.