gnom
06-13-2005, 10:31 AM
Is there any function in ASP that is equivalent to document.getElementById() from JavaScript? I nead to set new value to a hidden field of a form, and i don't know how?
| //flex table opened by JP
Click to See Complete Forum and Search --> : getElementById in ASP gnom 06-13-2005, 10:31 AM Is there any function in ASP that is equivalent to document.getElementById() from JavaScript? I nead to set new value to a hidden field of a form, and i don't know how? ScaryBinary 06-13-2005, 02:03 PM ASP is a server-side scripting technology; all the code is executed on some webserver and then the results are sent to a user's (a "client") browser (usually in the form of HTML). Once the results are sent, ASP has no control over them. This means you can't access the HTML page using ASP once it's been sent to the client browser. If you want to dynamically change the values of form controls, you'll have to use javascript (or some other client-side scripting lanuguage). An alternative would be to submit the form with whatever values are in it back to an ASP script, which would then re-compute the form values and re-display the page to the browser. If you explain what you're trying to do, I bet we can find a way to do it in Javascript. gnom 06-13-2005, 02:33 PM I created a form which has to be field out in a proper way. But everything is created dynamicaly since whole script is protected by password (with that form user can modify a database). When the form is filed out and user clicks submit, data are redirected to the same script, but now fields from form are not blank and can be checked. When i check them, each time something is wrong i put some info to a variable and at the very end i create a hidden input field with value storing that info. When the script is activated one more time hidden field of the form is not blank, so I can't continue and i have to ask user to correct his/her errors. And now is the problem... when user will corect something or not and submit, than i will check everything once again and will have to change this hidden value. Perhaps i should simply create one more hidden field of the same name but with new value, and this way the old value will be overwriten? How do you think? causticVapor 06-13-2005, 10:14 PM You could use single key encryption. From the sounds of it, you're putting a special value in a hidden input field - and that could work, but isn't as secure as hashing the values and locking them with a key stored in the server scripts. It makes it much more transportable. Make sure you encode the POSTed or GETed values in base64 before sending them, otherwise data could be lost. SysOpt.com
Copyright Internet.com Inc. All Rights Reserved. |