1 Replies - 4781 Views - Last Post: 25 April 2012 - 05:39 AM Rate Topic: -----

#1 De.camm  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 24
  • Joined: 05-March 12

My Radio button cannot save the changed value

Posted 24 April 2012 - 11:44 PM

I actually doing the edit part user interface, the actually way is when open the screen edit,
the form will automatically come with their own value (extract from database), but when user make changers on the text box and radio button, and click submit, the new changers value suppose to be save in database.
My text box field doing that, but my radio button have problem to save the new value changed by user,
the value at database still hold the last value not the new one. Here is my radio button coding :
<tr>
   <td height="50"><b>WORK SATISFACTION</b></td>
   <td> : </td>
   <td colspan="5">
      <cfoutput>
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '1'>Checked</cfif>> 1 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '2'>Checked</cfif>> 2 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '3'>Checked</cfif>> 3 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '4'>Checked</cfif>> 4 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '5'>Checked</cfif>> 5 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '6'>Checked</cfif>> 6 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '7'>Checked</cfif>> 7 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '8'>Checked</cfif>> 8 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '9'>Checked</cfif>> 9 &nbsp;
      <input type="radio" name="workSatisfaction" id="workSatisfaction" value="#qStuD.e_wsatisfaction#"<cfif qStuD.e_wsatisfaction EQ '10'>Checked</cfif>> 10 &nbsp;
      </cfoutput>
    </td>
</tr>



and here is my update query coding :
<cfif isDefined ("Form.btnSubmit")>
	<cfquery name="qeDitAlumni" datasource="#Application.fw.Config.DSN#">
    	UPDATE stu_Alumni
        SET
            stu_contactno = <cfqueryparam value = '#Form.hp#' cfsqltype = "cf_sql_char">,
            stu_email = <cfqueryparam value ='#Form.Email#' cfsqltype = "cf_sql_char">,
            stu_status = <cfqueryparam value ='#Form.StatUs#' cfsqltype = "cf_sql_char">,
            stu_nationality = <cfqueryparam value = '#Form.Nationality#' cfsqltype = "cf_sql_char">,
            stu_add1 = <cfqueryparam value = '#Form.Add_1#' cfsqltype = "cf_sql_char">,
            stu_add2 = <cfqueryparam value = '#Form.Add_2#' cfsqltype = "cf_sql_char">,
            stu_postcode = <cfqueryparam value ='#Form.postkoD#' cfsqltype = "cf_sql_char">,
            stu_district = <cfqueryparam value = '#Form.District#' cfsqltype = "cf_sql_char">,
            stu_state = <cfqueryparam value = '#Form.State#' cfsqltype = "cf_sql_char">,
            e_posts = <cfqueryparam value = '#Form.Posts#' cfsqltype = "cf_sql_char">,
            e_organization = <cfqueryparam value = '#Form.Orgnzn#' cfsqltype = "cf_sql_char">,
            e_add_1 = <cfqueryparam value = '#Form.AddE_1#' cfsqltype = "cf_sql_char">,
            e_add_2 = <cfqueryparam value = '#Form.AddE_2#' cfsqltype = "cf_sql_char">,
            e_postcode = <cfqueryparam value = '#Form.postcodE#' cfsqltype = "cf_sql_char">,
            e_district = <cfqueryparam value = '#Form.District_E#' cfsqltype = "cf_sql_char">,
            e_state = <cfqueryparam value = '#Form.State_E#' cfsqltype = "cf_sql_char">,
            e_workstatus = <cfqueryparam value = '#Form.WorkStatus#' cfsqltype = "cf_sql_char">,
            e_telno = <cfqueryparam value = '#Form.TN#' cfsqltype = "cf_sql_char">,
            e_faxno = <cfqueryparam value = '#Form.FN#' cfsqltype = "cf_sql_char">,
            e_monthlysalary = <cfqueryparam value = '#Form.monthLySalary#' cfsqltype = "cf_sql_char">,
            e_wsatisfaction = <cfqueryparam value = '#Form.workSatisfaction#' cfsqltype = "cf_sql_char">,  <!---here--->
            fs_add1 = <cfqueryparam value = '#Form.FSadd1#' cfsqltype = "cf_sql_char">,
            fs_add2 = <cfqueryparam value = '#Form.FSadd2#' cfsqltype = "cf_sql_char">,
            fs_resultObtain = <cfqueryparam value = '#Form.FS_result#' cfsqltype = "cf_sql_char">,
            fs_start_study = <cfqueryparam value = '#Form.FS_start#' cfsqltype = "cf_sql_char">,
            fs_end_study = <cfqueryparam value = '#Form.FS_end#' cfsqltype = "cf_sql_char">,
            editdate = <cfqueryparam value = '#Form.EditDate#' cfsqltype= "cf_sql_timestamp">
        WHERE studentcode = '#url.edit#'
    </cfquery>
    <cfscript>
    Application.fw_Notice("Student details is successfully edit <br> press <a href=index.cfm?section=Alumni&action=ListinG>| finish |</a>.");
    </cfscript>
</cfif>



no error popup for this code, but the problem is "radio button" not function for getting the new changes value (extract value from the database its working).

Is This A Good Question/Topic? 0
  • +

Replies To: My Radio button cannot save the changed value

#2 Craig328  Icon User is offline

  • I make this look good
  • member icon

Reputation: 1910
  • View blog
  • Posts: 3,441
  • Joined: 13-January 08

Re: My Radio button cannot save the changed value

Posted 25 April 2012 - 05:39 AM

I'm not entirely sure what you're trying to do here De.Camm but, from what I could gather, it seems you're trying to change form field values on the fly when the user makes some kind of change to the form.

This isn't so much a CF question as it would be a Javascript question. I did a quick Google and found literally dozens of examples for how you can manipulate form field values with Javascript. One of them is here.

Good luck!
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1