HTML - Readonly Form Elements With Variables *please Help*
Hi,
I have a page that uses AJAX to set a variable, the variable is either true or false. On the page there is a form with a text input, i would like the variable to dictate whether the element is read only or not. So instead of: <input name="cd" value="title" readonly="readonly" /> I would rather something like: <input name="cd" value="title" readonly="$lock" /> Note: I am aware that $lock is PHP but I am not familiar with the syntax in this instance. Thanks in advance, Tom Similar TutorialsHi, I have used the following html tag to display a read only attribute in the form. <input name="country" type="text" class="contentcopy" value="<cut value="${XYZ}"/>" size="30" readonly="true" style="background-color:#F4F4F4;color:gray"> This renders the value as readonly, but i'm able to change the value using firebug and postback an edited value. Could you please advice me how to over come this issue? Hi, I have a form that has a bunch of cascading drop downs - something like Country->State->City->. Each subsequent drop down is populated based on what is selected on the preceding one. What I am having trouble with is the positioning of the labels for these dropdowns. For ex., I want the word 'Country' written exactly above the Country dropdown, the word 'State' above the State dropdown and so on. Unfortunately, anything I try doesn't seem to work. I have used every CSS property I thought would help - margin, position, padding etc., but nothing works. The problem is when I resize the window the labels and the dropdowns are thrown out of whack and it becomes difficult to figure out just by looking which label belongs to which dropdown box. How do I fix this and align the form with their respective labels and make it independent of the size of the window? Thanks! I created a form with html. At the end of the form there are two buttons, the button "entry", and the button "reset". When clicking on "entry" button i want to print the form's elements. How can i do it? Hi: I would like the freedom to position <input> elements of a form to specific places on my page. What is the proper way to do that please ?? Thanks, -Mel Smith I have created a nice Newsletter Registration form, but I would really like to modify the form so that instead of displaying the browsers default images for text fields, checkboxes, etc, I want it to display my images that I have created. Is this possible without stepping into flash? Thanks Guys! -NH I have a form where a select list can be updated by clicking 'update' next to it. When this is clicked I would ideally like just that to be updated, but I do not think this is possible. I was thinking of having two form actions, one that submits the form as usuall, but one that submits the form somewhere else, depending on which submit button is clicked. If I could have two submit buttons, I could use one to submit the form back to the same script, with the script re-filling the form elements that where filled out, and the select box would then update. So, my main question is...... Is there a javascript submit function that can change the destination of the form? Perhaps this should be in the javascript section! I am trying to set up a contact form for a website I am building. We will be posting a couple of the messages we recieve on different pages on the site. To avoid having too many contact forms, we've lumped them all together into one, using a Drop Down Form Element. I am trying to set it up so that when certian elements are selected from the "Who would you like to contact?" dropdown menu, a check box will come up saying wheather or not they mind us posting their message on the site. I'm attempting to do this using Java Script and this is the code i've been using... PHP Code: <script language="javascript"> function enableaccept() { var who = document.theForm.elements['who'] var accept = document.theForm.elements['accept'] if (who.value=="N") { accept.disabled = true } else { accept.disabled = false } } </script> and in the dropdown menu, this is how i have set it up to work... PHP Code: Who would you like to contact?<br> <select size="1" name="Who"> <option></option> <option value='n' onClick="enableaccept()">__________</option> <option value='y' onClick="enableaccept()">Testimonials</option> <option value='y' onClick="enableaccept()">Praise Reports</option> <option value='y' onClick="enableaccept()">Request Prayer</option> <option value='n' onClick="enableaccept()">Booking Information</option> <option value='n' onClick="enableaccept()">Technical Support</option> </select> (The _________ is where a name should go that I chose not to put out on the forums, no offense to anyone...) For some reason, the check box is still enabled no matter what, and I'm so utterly confused...I'm still rather new to Javascript, so there may be something wrong with my coding, but it all seems that it would make sense...if you could help me out, that would be greatly appreciated In Christ Alone, Fire Fall D0wn I have a form but a text field and a hidden field don't come in form elements.I am alerting all form elements in a javascript function which is invoked on press of a button and these two form elements don't come. Any idea why that will happen. JS function which alerts the form elements is as follows :- function populateSubmitProfile() { var i =0; alert("Number of forms "+document.forms.length) ; for( i = 0 ; i < document.forms[0].elements.length ; i++) { alert("Name of the elements :"+document.forms[0].elements[i].name) ; } } In a regular form with text fields, can I pass the imput from the user directly into a hidden textarea from multiple fields intertwined with html? Example: <form> <input type="text" name="firstname"> <input type="text" name="lastname"> <input type="text" name="occupation"> <input type="hidden" value="some html + firstname + some html + lastname + some html + occupation"> </form> I think this might require some javascript. Is something like this possible? Hey guys, I'm fairly new to programming web forms on my own. (I've used some Joomla/Mambo components that eased the process). I understand the basics of forms and what not, but was curious as to what the best way to pass variables from an email (pre-filled) to a form would be without using Server-Side Scripting of any kind. (I could easily write a PHP page to do so, but on this specific project I don't have access to any kind of scripting on the server side). I have thought about doing it one of two ways. The first way would be to write some Javascript that saves the fields I need as cookies and then calling those cookies back on the webform. The other way, was to pass the variables through the URL. I don't know if this is possible without Server-Side Scripting or not. I'm sure I could hack up some sort of Javascript code to read the URL and break it into the relevant variables but that seems like a lot of work for something so simple. Is there a way to use the GET method at all to pull those variables from the URL? Also, sorry for not posting this in the Client-Side Scripting forum, but I wasn't sure if there were other solutions to this problem that wouldn't require any scripting at all. Thanks Again, -Ian- Hey guys, i'm just starting up with html, and am having a few problems. I have a php file titled "stats.php" that return results when you direct your url to: /stats.php/default/dricho Its a dynamic sig generator through a php file. I have created a form that allows you to simply add in the details so that it generates the link for you. But i am having an issue. here is the form: HTML Code: <form action="http://www.domain.com/sig/stats.php" method="post"> <select name="background"> <option>maple</option> <option>default</option> </select> Name: <input name="rsn" type="text" /> <input type="submit" /> </form> How can i make it so teh results open a link based on teh items chosen? i.e. if i chose maple and input dricho it would direct the url to: "/stats.php/maple/dricho"? All help is greatly appreciated, Daniel I am using a form to submit a name and password for log on. The form is using password type fields. However, once the form is submitted the results are showing in the url query string of the return page. How do I prevent this? Hi! I've been trying none end to get this form working for a friend..I always get the same error - Here's the code, it points to a script with www.godaddy.com (can anyone please look into it?) Thx!! <form name="contact" method="post" action="gdform.asp" enctype="multipart/form-data" id="form"> <input type=hidden name="recipient" value="exquisitetaramtl@live.ca"/> <input type=hidden name="subject" value="Online Inquiry"/> <input type=hidden name="redirect" value="http://www.exquisitetara.com/index3.html"/> <table style="width:515px; height: 149px;" class="style19"> <tr> <td style="width:210px"> <table style="height: 155px"> <tr> <td style="">Name: <br /> <input name="name" type="text" /></td> </tr> <tr> <td style="">E-mail: <br /> <input name="email" type="text" /></td> </tr> <tr> <td style="">Phone: <br /> <input name="phone" type="text" /></td> </tr> </table> </td> <td style="">Message: <br /> <textarea name="message" style="width: 336px; height: 107px"></textarea> <div style="text-align:right"> <span><a href="#" onClick="document.getElementById('form').reset()">clear</a></span><img src="images/spacer.gif" alt="" width="26" height="1"/><span><a href="#" onClick="document.getElementById('form').submit()">send</a></span></div> </td> </tr> </table> </form> How do I make element's change their height automatically depending on whether they have anything contained within them? My page background is a div's bg image but the div hasn't expanded to the size of the contained elements. The div's name is nicola-bg Here is the site I have the same problem too with #image-section. That div is styled to have large borders but the borders don't extend to the height of the div's containing elements. I'm trying to understand the need for <div> elements, couldnt we do the same things with a <p> element. I understand the <span> element because it allows you to have box models for inline elements. Is <div> mostly to keep things organized and easy to read? This is my first project using CSS and anything other than basic HTML and it's been going good so far. The page I'm designing is for my new guild on World of Warcraft (yes I'm addicted) and my problem is with the Content DIV i created. The site is http://twilightsdawn.50webs.com/index.html In the code, I nested DIV elements containing the actual news posts themselves within the actual Content DIV, and by not specifying a height I had hoped the element would resize and simply tack on extra DIVS below one another. This seems to be the case with Banner and Content Text DIVs but the second set simply overwrite the previous and all my attempts to force the second "news post" below the first have failed or resulted in bizarre alignments. I am at a loss and would appreciate any design suggestions and/or feedback on the code. Thanks Is there a way that anyone knows of to put list items side by side in a row? I'm currently working with some html/css/jquery that allows you to move li elements around and order them. However, instead of being on a new line for each element, I'd like to put several side by side in a row. Is there any way with html/css to make this happen, or is there no way to change the "nature" of li elements? Hi, I have a form with html combo and input elements in a dialog with scrollbar. Problem I am facing is some of combo elements which are disabled disappear. When I scroll the disabled elements appear again. This happens only on IE. Works fine on firefox. Is there any issue with disabled elements as such. Thanks I am using ASP.NET however my front end design skills arent that great. what I was wondering was, since I am using a repeater or a datalist control, I want each element to have a nice design. the site is like a products site (retail type website). I mean, the styling for each element is something I im unsure how to design, any suggestions or tips on how each element should be designed/layed out? product detail: qty, product name, image, smalldescription. styling/designing/theme doesnt matter, you can include that. just a rough guide would be nice in terms of how the layout for a product should be design, like where each piece of information should be layed out. thanks. thanks. |