Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Updating multiple fields using just one text field using dreamweaver MX

  • 31-05-2006 1:57pm
    #1
    Registered Users, Registered Users 2 Posts: 224 ✭✭


    Hi,

    Query for you guys. Im currently building a system using ASP VBScript and MS SQL Server.

    I currently have 3 fields which all contain numeric values (in this instance they are percentages). I want to give the user the option of updating/changing these percentages but instead of having to update all 3 %'s they just fill in a single text field and it updates the 3 fields like wise. (BTW the 3 %'s are always the same...) Can this be done through dreamweaver or will it take a lot of hard coding...


Comments

  • Registered Users, Registered Users 2 Posts: 683 ✭✭✭Gosh


    You could have a JavaScript function on the client side but this would fail if Javascript was blocked by the browser.

    You would have to force the form to be submitted back to the server whenever the field with the percentage increase/decrease is changed for it to send back the form with the values updated.
    Can this be done through dreamweaver or will it take a lot of hard coding...

    Yes you can all of this in Dreamweaver


  • Moderators, Politics Moderators Posts: 41,240 Mod ✭✭✭✭Seth Brundle


    [leave DW out of it and learn how to do it right]

    If they type out something within the box then to collect it just split the submitted textbox value at the vbCrLf like this...
    <form action="?id=1" method="post">
    <input type="text" name="txt"
    <input type="submit">
    </form>
    <%
    if request.querystring("id") = 1 then
             for each i in split(request.form("txt"), ",")
                 Response.write(trim(i) & "<br />")
                 'or insert into your database
             next
    end if
    %>
    
    However, you don't really have any way of making sure they get the values in the right order, or that they insert a comma or whatever after each percentage. I guess that you should check that each one is numeric also.


  • Registered Users, Registered Users 2 Posts: 683 ✭✭✭Gosh


    kbannon wrote:
    [leave DW out of it and learn how to do it right]

    :rolleyes:


  • Moderators, Politics Moderators Posts: 41,240 Mod ✭✭✭✭Seth Brundle


    Im not sure what that meant but my experience of DW is that it makes tweaking the code much more painful that it may be had the ASP been hand coded.
    its the same for DW JavaScript.


  • Banned (with Prison Access) Posts: 16,659 ✭✭✭✭dahamsta


    He's right you know. DW is grand for doing layouts, but it shouldn't be used for more advanced functionality. The code it produces isn't as bad as Frontpage used to be, but it's still crufty and it can't be trusted.


  • Advertisement
Advertisement