Design Issue When Implementing a Simple Shopping C

Results 1 to 2 of 2

Thread: Design Issue When Implementing a Simple Shopping C

  1. #1
    Join Date
    Dec 1969

    Default Design Issue When Implementing a Simple Shopping C

    I&#039ll try not to be longwinded here.<BR><BR>I am attempting to design a system builder for a friends company. I have each system part in a database with PARTID, PARTTYPE, PARTDESCRIPTION, PARTCOST, PARTRETAIL. I created a separate dropdown menu for each PART TYPE and populated each dropdown from the database. I have used the PARTRETAIL as the dropdown value and PARTDESCRIPTION as the dropdown choice. <BR><BR>The dropdowns all populate correctly. My javascript function to total the system price without refreshing the page works great. My problem is passing the dropdown choice (not the value) to the next page.<BR><BR>My friend is really excited about the fact that he doesn&#039t have to refresh the page to total his system price, but is this a design mistake on my end? Should I have passed the system descriptions, then totaled values when refreshing the page?<BR><BR>I have read every newsgroup I could think of to see if I could pass both the dropdown choice and value to the next page, but I cannot find a way to do this. <BR><BR>Any suggestions would be appreciated.<BR>Any design approaches would also be appreciated.<BR><BR>I am new to ASP design, as you can probably tell by my question.<BR><BR>Thanks in advance.<BR>RAJ

  2. #2
    Sheetal Guest

    Default RE: Design Issue When Implementing a Simple Shoppi

    Hi Raj,<BR><BR>This really is a good idea. Even I have tried to do something like this before and faced a similar problem. The solution I used could be little cryptic, but still, it worked. <BR><BR>You can store the PARTRETAIL and PARTDESCRIPTION BOTH as a value for the dropdown, delimited with comma (or any other character of your choice). e.g. &#060;select ...&#062;&#060;option value="3000,Part Description here"&#062;Part Description here&#060;/option&#062;.....&#060;/select&#062;<BR><BR>You will have to decript it twice. <BR><BR>First time, in your javascript function, that you may be calling on the onchange event of the dropdown, to change the total price, you will have to separate the two values. e.g you may get the value as - "3000,Part Description here". You can use split function to separate the two values and use the first to calculate the total. There can be n number of ways to do the splitting.<BR><BR>Second time, when you get this value ("3000,Part Description here") in the Request.Form collection, on the next page, you need to separate the two and extract the description. <BR><BR>This is the simplest solution I could think of. <BR><BR>Another way, could be -<BR><BR>Have a hidden valirable in your form and manipulate that to give you a key-value pair for the Parttype and Partdescription, every time the user changes the dropdown option. You can do this since, here in javascript you can get the PARTDESCRIPTION using ".text" property.<BR>This hidden variable may look like - <BR>"Parttype2:Desc2,Parttype1:Desc1,Parttype3:Des c3"<BR>Use this in the next page after decoding it.<BR><BR>Hope this helps, all the best.<BR><BR>Regards,<BR>-Sheetal.<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts