Jump to content

Hide and show different hidden fields with javascript.


woodhacker98

Recommended Posts

Hi!

I have a form with a lof of hidden fields (basically a search form that will pass some variables to a non editable php CMS system to search in different categories - and I MUST pass exactly the right variables to the php script ). I apply values with DOM in the different hidden fields based on which radiobutton the user has selected. If he selects "web" radiobutton, I apply values to a number of fields with a function when the user has pushed the submit button. 

The rest of the hidden fields doesn't get any values, and shows in the adressfield in the browser like this: ....&variable1=&variable_not_used=& and so on...

The script is running perfect.. But now I have a little problem..  I have to extend the script with a new radiobutton to search in a new category. And when I search in a new category, the phpcms system doesn like one of the other variables i send in GET, even if it is blank/unset.. Yes the system suck.. But I cant do anything about it..

Therefore this question:

Is it possible to "hide" a hidden element in a form,  and do it "visible" when I need it? So it doesnt beeing sent with the GET action?

I have tried with:

[code]<div id="hide_me" style="visibility:hidden">
<input type="hidden" name="news" value=""></div>[/code]

But this only works with visible objects in html.. The variable is sent by GET anyway..

Do you guys have a hint for me?

Regards
Tore
Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.