471,571 Members | 1,053 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,571 software developers and data experts.

Problem with onClick="function()"

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() {

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

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

<cfif IsDefined("form.namasykt") AND #form.namasykt# NEQ "">
, ......

so, please somebody help me...thanks
Apr 19 '07 #1
1 8776
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
reply views Thread by XIAOLAOHU | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by Vinnie | last post: by
reply views Thread by lumer26 | last post: by
reply views Thread by lumer26 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.