ferdia Posted April 3, 2011 Share Posted April 3, 2011 Hey guys. Total rookie in JScript here. I've a form, here are three of the elements: <tr> <td width="70" valign="top"><strong>Type:</strong></td> <td width="204"><select name="my-item-name" size="4" id="myitemname"> <option value="Object 1">Object 1</option> <option value="Object 2">Object 2</option> <option value="Object 3">Object 3</option> </select></td> </tr> <input type="hidden" name="my-item-id" value="<?php echo $row_rsOil['id']; ?>" /> <input type="hidden" name="my-item-price" value="<?php echo $row_rsOil['price']; ?>" /> <input type="hidden" name="my-item-url" value="tramore-oil.php" /> <tr> <td><strong>Quantity:</strong></td> <td><input name="my-item-qty" type="text" id="myitemqty" size="5" maxlength="5" /> <span id="msg">Litres</span></td> </tr> <tr> <td><strong>OR Value:</strong></td> <td>€<input name="my-item-value" type="text" id="myitemvalue" size="5" maxlength="5" /></td> </tr> Basically what I need is this. When someone selects an object in the select box. I need "Quantity" and "Value" to prepopulate, and change if a different object is selected. There is a second task the JScript has to handle though. Value is a multiple of Quantity. If someone updates one, I need the other to change too. Advice would be greatly appreciated Quote Link to comment https://forums.phpfreaks.com/topic/232604-form-element-dynamic-changes/ Share on other sites More sharing options...
ferdia Posted April 3, 2011 Author Share Posted April 3, 2011 If it helps explain my situation better, I basically need the form I posted above, to behave like this one: https://www.jonesoil.ie/order-online/ Quote Link to comment https://forums.phpfreaks.com/topic/232604-form-element-dynamic-changes/#findComment-1196406 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.