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

Updating multiple fields using just one text field using dreamweaver MX

Options
  • 31-05-2006 2:57pm
    #1
    Registered Users 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 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: 39,923 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 Posts: 683 ✭✭✭Gosh


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

    :rolleyes:


  • Moderators, Politics Moderators Posts: 39,923 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